When starting the game from an exported version it tries to alocate memory until reaches my pc's maximum and crashes returning said error. When I run in the editor it takes 1.4gb of ram to run, but when the exported version launches it keeps growing the memory used and never launches, crashing as a result.

Returned error:
ERROR: Condition "!_ptrnew" is true. Returning: ERR_OUT_OF_MEMORY
at: resize (./core/templates/cowdata.h:297) ERROR: Condition "err" is true. Returning: true at: push_back (./core/templates/vector.h:317)

Similar error found, but not resolved
https://github.com/godotengine/godot/issues/79555

Any tips to make it reproduceable or fixed are appreciated.

  • xyz replied to this.
  • JulianoBZ the actual game when launched via the editor takes 300mb

    Why don't we see it in the profiler? Try to run the profiler for a long time and see how the memory behaves.

    Concluding from the error messages, the crash happens when resizing an array by adding an element to it via push_back() call. It may or may not be from script's Array::push_back(), but it's worth investigating by eliminating all Array::push_back() calls as well as equivalent calls for packed arrays if you use any.

    To isolate the problem, you may also try to run as little of the game as is enough to cause the leak. So eliminate bit by bit from the game as long as the thing persists.

    JulianoBZ How is memory behaving in Godot's profiler in the long run? Are you creating a lot of stuff via scripts?

      xyz Nope, the profiler runs fine. I had memory leaks by instancing a lot of objects in a past project and the profiler/monitor did accuse that problem AFTER starting the game even in the editor, it does not behave abnormaly in here.

      The first small peak is when loading a lobby, the second is starting the game and spawning a character. The exported version wont even open

      • xyz replied to this.

        JulianoBZ You said editor version takes 1.4 gigs. We see only 85 megs in the profiler. What's with the rest?

          xyz My mistake! 1.4gb is the editor, the actual game when launched via the editor takes 300mb~.

          But the exported version memory usage just goes up and up until it returns the error and closes.

          • xyz replied to this.

            This person had a problem with GLB files, wich i'm using, imported first from Blender and now Blockbench. Their problem was answered 3 weeks ago, and its said to be fixed in one of the branches, maybe I should just wait a bit for the next update to export it without errors or download the new branch?

            https://github.com/godotengine/godot/issues/80431

            JulianoBZ the actual game when launched via the editor takes 300mb

            Why don't we see it in the profiler? Try to run the profiler for a long time and see how the memory behaves.

            Concluding from the error messages, the crash happens when resizing an array by adding an element to it via push_back() call. It may or may not be from script's Array::push_back(), but it's worth investigating by eliminating all Array::push_back() calls as well as equivalent calls for packed arrays if you use any.

            To isolate the problem, you may also try to run as little of the game as is enough to cause the leak. So eliminate bit by bit from the game as long as the thing persists.

              xyz Thank you very much for your hel today. It does appear to be a problem with glTF files, the blender ones are 2.0, the BlockBench ones are not. I have a list where I preload everything I'll need to spawn quickly in the game, when disabling the player models, done in BlockBench, it launched, and I didn't un-preload the blender ones, the github call was right, something about bits of the saved file didn't go well with godot, probably because its not 2.0.

              Again, thank you.