Hello, I would like to use Godot for creating a desktop application, so the project is mostly Control nodes, but first I would like to understand something.
Does anybody know why an exported empty project, empty scene (on Windows) uses ~200+ MB of RAM when using the d3d12 driver and ~400 MB of ram when using the vulkan driver?
In the Debug>Monitors tab for Memory it says it uses ~65 MiB, so I’m assuming the rest of ~140 MB (d3d12) / ~340 MB (vulkan) is used by the engine itself.
Is there any way to lower the default memory usage for an exported application that’s used only for the 2D/UI side of Godot?
Thank you for the reply! Yeah, I’ve been through that page and dismissed it because it wasn’t mentioning anything about lowering memory consumption, but I guess removing modules could lead to less memory being used.
There isn’t much that can be done about it, unfortunately. Build-time options generally won’t impact memory usage noticeably (only binary size).
There are plans to further optimize the engine which may lead to memory usage reduction, but reducing memory usage isn’t the main goal of this effort. There’s often a tradeoff between CPU utilization and memory utilization (to simplify: if you cache more things, you don’t have to compute as many things). Godot (and most other game engines) tend to favor saving CPU cycles at the cost of memory usage, as CPU cycles are a more critical resource when running games.
You may be able to save a few MBs of memory by changing the audio driver to Dummy in the project settings (case-sensitive), and also change the 2D/3D physics server settings to Dummy. As a bonus, this will prevent the project from appearing in the list of applications playing audio and reduce CPU usage a little.
You could also try using the Compatibility renderer if you don’t need features only available in Forward+/Mobile. Its more lightweight design should result in reduced memory usage.
Lastly, if you’re in a heavily memory-constrained scenario, you could keep using Godot 3 as it uses much less memory in general compared to Godot 4.
Thank you for all the information, I really appreciate it.
Other than Vulkan needing 200 MB more RAM at startup, a base usage of ~200MB isn’t even all that bad in a world where Discord and a few browser tabs eat gigabytes.
And to be fair to Godot, a WPF application with some 3rd party controls already tends to reach ~200 MB memory consumption.