My game takes a gigabyte of ram to run? (Ubuntu)

Hi all,

After dealing with multiple computer crashes, it occurred to me to check the ram usage of my game while it ran. System monitor says it was eating up a whole gigabyte.

I’d estimate my game only handles a few hundred to maybe somewhere over a thousand objects (not even very complex ones, just sprites, a collision object, and a small script) at any given time, and yeah I know that’s a lot but I can’t imagine that needing a whole gigabyte. Do y’all know what could be going on?

You can use the debug profiler while your game is running from the editor with
Debug → Open Web Profiler: to inspect resource usage while running
Debug → Open Resource Profiler: to inspect resource size of the bundle
There you can check if a lot of memory is used by textures, audio, or Lua code. If you have many textures that are loaded all the time, that could be the reason.

And just to be sure, the Defold editor has your project name as the title, so look at the memory usage of either dmengine if you are running a build from the editor, or use a release bundle to test. That the editor uses a gigabyte of memory is totally normal. For games, I’d say small projects use 100-200 MB, larger ones 200-500 MB , and games with a lot of resources loaded could take over 1 GB.