Skip to content

Warn when running low on disk space when performing certain editor operations#105755

Open
Calinou wants to merge 1 commit intogodotengine:masterfrom
Calinou:editor-warn-low-space-on-disk
Open

Warn when running low on disk space when performing certain editor operations#105755
Calinou wants to merge 1 commit intogodotengine:masterfrom
Calinou:editor-warn-low-space-on-disk

Conversation

@Calinou
Copy link
Copy Markdown
Member

@Calinou Calinou commented Apr 25, 2025

The following editor operations will now warn the user if the available space on the target disk is low:

  • Saving a scene (< 1 GiB).
  • Importing a set of resources (< 2 GiB).
  • Downloading an export template (< 1 GiB, checked per-file).
  • Installing export templates from a TPZ (< 4 GiB).
  • Exporting a project (< 10 GiB).
  • Packing a project as a ZIP file (< 10 GiB).

@Calinou Calinou requested review from a team as code owners April 25, 2025 15:55
@Calinou Calinou added this to the 4.5 milestone Apr 25, 2025
@Calinou Calinou force-pushed the editor-warn-low-space-on-disk branch from c49f784 to a71811a Compare April 25, 2025 16:13
Comment thread editor/editor_node.cpp Outdated
@Calinou Calinou force-pushed the editor-warn-low-space-on-disk branch from a71811a to 2244457 Compare April 29, 2025 00:34
@Alex2782
Copy link
Copy Markdown
Member

Alex2782 commented Apr 29, 2025

I increased it to 100GB everywhere to test the warning.

The warning is not yet displayed in the Advanced Import Settings dialog, so I think it should be included there as well, or is there anything against it? There are also import dialogs for "Font" and "Audio".

screenshot

Bildschirmfoto 2025-04-29 um 15 02 26

On MacOS, according to "Finder" I have more free space.

image

@Calinou
Copy link
Copy Markdown
Member Author

Calinou commented Apr 29, 2025

The warning is not yet displayed in the Advanced Import Settings dialog, so I think it should be included there as well, or is there anything against it? There are also import dialogs for "Font" and "Audio".

I've added the warning to all advanced import settings dialogs.

On MacOS, according to "Finder" I have more free space.

This is a GiB (binary prefix) versus GB (decimal prefix) difference. It's why when you buy a 500 GB hard drive, it appears to be 465 GB in the OS 🙂

@bruvzg
Copy link
Copy Markdown
Member

bruvzg commented Apr 29, 2025

On MacOS, according to "Finder" I have more free space.

This is a GiB (binary prefix) versus GB (decimal prefix) difference.

This + Finder also include "purgeable" space (local time machine snapshots and similar stuff).

Screenshot 2025-04-29 at 17 00 45

@Calinou Calinou force-pushed the editor-warn-low-space-on-disk branch from 2244457 to 7e9eb3d Compare April 29, 2025 14:32
@Calinou Calinou requested a review from a team as a code owner April 29, 2025 14:32
Copy link
Copy Markdown
Member

@Alex2782 Alex2782 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, tested on MacOS and Android.

@akien-mga
Copy link
Copy Markdown
Member

Exporting a project (< 10 GiB).
Packing a project as a ZIP file (< 10 GiB).

I think this might be too restrictive.

Some people can use Godot on mobile devices (tablets, phones, Steam Deck) where storage is at a premium, and it's totally reasonable to export e.g. a simple 2D game with 200 MB of assets when you're on a 64 GB SD card with only 3-4 GB left.

Ideally we should get a feeling for how heavy the PCK is going to be (e.g. by checking the size of .godot) so that the warning is somewhat more accurate.

I haven't tested the PR to check, but if we can't get a level of accuracy which actually matches the developer's available disk space and project needs, maybe we should just have the possibility to disable these warnings for users who know they're operating within narrow limits.

@Repiteo Repiteo modified the milestones: 4.5, 4.6 Jun 19, 2025
@insomniacUNDERSCORElemon
Copy link
Copy Markdown

insomniacUNDERSCORElemon commented Jun 22, 2025

Some people can use Godot ... where storage is at a premium, and it's totally reasonable to export e.g. a simple 2D game with 200 MB of assets when you're on a 64 GB SD card with only 3-4 GB left

I would say there should be different types of warnings. In output (warnings/errors depending on severity), and in extreme cases (0-50MiB free) warn the user with a dialog when they open a project. Especially as this will continue being an issue until the user intervenes to free up space.

I'm guessing even a modest .godot cleanup could also be a quiet error prevention done at project open as well (this might also be a less annoying log message that still hints at an issue). At least in my case I'm pretty sure the 1.7GiB was all just no-longer-needed cached data related to shaders/fog.

Either way it would be nice to get something in for 4.4.2 (or 4.5). At least for the worst-case-scenarios, even if it does not touch the export process (although I would hope that actually running out of data here would just fail/cancel the export).

@Calinou Calinou force-pushed the editor-warn-low-space-on-disk branch from 7e9eb3d to fd96935 Compare December 18, 2025 01:22
@Calinou Calinou requested a review from a team December 18, 2025 01:22
@Calinou Calinou force-pushed the editor-warn-low-space-on-disk branch from fd96935 to d095a66 Compare December 18, 2025 15:30
@akien-mga akien-mga modified the milestones: 4.6, 4.x Jan 13, 2026
@Repiteo Repiteo requested a review from a team as a code owner February 17, 2026 20:10
…erations

The following editor operations will now warn the user if the available
space on the target disk is low:

- Saving a scene (< 1 GiB).
- Importing a set of resources (< 2 GiB).
- Downloading an export template (< 1 GiB, checked per-file).
- Installing export templates from a TPZ (< 4 GiB).
- Exporting a project (< 10 GiB).
- Packing a project as a ZIP file (< 10 GiB).
@Calinou Calinou force-pushed the editor-warn-low-space-on-disk branch from d095a66 to 0a5fe2e Compare April 27, 2026 18:41
@Calinou Calinou requested a review from a team as a code owner April 27, 2026 18:41
@Calinou
Copy link
Copy Markdown
Member Author

Calinou commented Apr 27, 2026

Rebased and tested again, it works as expected. I've applied the fix from #118924 (thanks @aurpine) 🙂

Ideally we should get a feeling for how heavy the PCK is going to be (e.g. by checking the size of .godot) so that the warning is somewhat more accurate.

This should be possible by looping over all files in .godot/imported (and all files outside of .godot/ for Pack Project as ZIP), but I don't know how fast this will be, particularly on large projects on Windows. This could be slow on network drives in particular.

Comment thread editor/editor_node.h
static void add_init_callback(EditorNodeInitCallback p_callback) { _init_callbacks.push_back(p_callback); }
static void add_build_callback(EditorBuildCallback p_callback);

void check_disk_space(const String &p_target_path, float p_size_gib, const String &p_rationale) const;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be static and then you won't need get_singleton at the callsites.

if (dir->get_space_left() < 10 * Math::pow(1024.0, 3.0)) {
// Less than 10 GiB available.
WARN_PRINT(vformat("Current available space on disk is low (%s). MovieWriter will fail during movie recording if the disk runs out of available space.", String::humanize_size(dir->get_space_left())));
WARN_PRINT(vformat("%s: Current available space on disk is low (%s). MovieWriter will fail during movie recording if the disk runs out of space.", path, String::humanize_size(dir->get_space_left())));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use check_disk_space here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn when disk space is low before installing export templates in the editor

8 participants