Running a Godot Project does not load the project, even if nothing was changed.

Godot Version

4.3

Question

I worked on my project for a while, I ran it and then saved, everything worked as normal. I watched a movie with my Dad, returned and now nothing will load. NOTHING HAS CHANGED.


image
This does not look normal, from a task manager perspective it looks like its doing something as its eating away at my RAM. ( I have 32 GBs and its chewing away at 14 ).

I have no idea what could have caused this, it worked as usual prior to me leaving to watch a movie. I did a double check, no infinite loops of code causing it to shut down.

Would appreciate some sort of clue to lead me in the right direction as to what caused this. I can reinstall Godot if needed I would just prefer not to.

I blame your dad.

Re-installing Godot isn’t going to solve your problem. You have a memory leak. Likely why you didn’t see this before is the amount of time you were running your program was rather short before you left to watch the movie.

Do this:

  1. Run your game.
  2. Press the Remote button in the Scene tab of your Editor.
  3. Play your game (or just let it sit there for a while if you weren’t playing and having this problem).
  4. Watch to see if the game tree grows. That will tell you where in your code to look.

I suspect that somewhere your code is creating objects and queue_free() is not being called on them so they are cluttering up your memory.

A few things you could try:

If you try to save a script file while your project is running, it can cause problems because it doesn’t have write access, so it’ll create a .tmp file, and that can cause a few bugs from my experience. If you have those .tmp files, you just need to delete them while Godot is closed and it should work normally after that.

Other thing you can try is to delete the hidden “.godot” folder.
This will force godot to reimport your asset files, and it should fix any corrupted or bugged asset files that might be breaking your project.

Lastly, it might be a bug in your project/code itself, there are a few corruption issues that will only show up after you restart godot. 99% of these strange bugs are due to cyclic reference errors due to inspector PackedScenes and preload. So you could try to replacing any “preload()” in your code with “load()” and see if that helps.


Lastly, if you want a completely clean start you can also delete your precompiled shader cache. This is probably not your problem but it is interesting to know.
You can use the Project->Open User Data Folder. There should be a vulkan folder there which contains your precompiled shaders. This is useful to know to test your game for shader compilation stutter (those lags that only happens the first time you see a shader)


Those fixes does not explain your huge RAM usage. But they usually fixes a lot of strange things.

The RAM thing is probably something with your code? If you are using a lot of physics objects that might be an issue.
I found out the hard way that Area2D collision pairs are very costly RAM-wise. I’ve made a mistake in my code and had 1k area2d inside each collising each frame, and those collisionpair info were taking about 10 GB~ of RAM.

1 Like