-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ObjectDB instances leaked at exit #51
Comments
I noticed this when doing a big refactor this weekend - I'm unsure if it's an issue with godot or godot-console but figured I'd let you know |
Very strange, I don't have that issue. I'll check later with the steps you've provided. Could you please:
Thanks |
Initially I simply made a fresh clone of this repo, ran the command and got this result:
Output from make: After this I opened
I clicked OK on that, closed the editor and re-ran the command with the following result:
Output from make: |
Ok so I repeated your process from last message and I got the same result. I forgot about images with imports which are not committed to the repo, that's why it wasn't running the first time. Also from what we can see with the both of those logs is that leak occurs only when engine exits with "panic". Also I've tested the repro example you've provided, it works like a charm without leaks. Could that be that you exit the process some "weird" way?
|
Interesting - I don't do anything fancy (launch via terminal and exit by clicking x and confirming in the engine). I just tested the same steps on my Windows 10 machine and managed to reproduce the issue. I wondered if it might be mono-specific or OSX-specific so I tested both mono and regular versions of Godot and reproduced it on both. I saved out the output: (start to finish, through starting the engine, installing godot-console, activating the plugin etc) |
You were right, I reproduced leak with the steps you've provided. Not sure how to fix it right now, but I'll definitely will. Thanks for reporting) |
I'm glad you managed to - if you need any help verifying stuff on osx I'll be happy to! My suspicion is some kind of circular dependency issue. I've had problems in the past with preloaded stuff not being cleared up properly (I solved my issue by moving all preloads into one utility class and referencing them through that). But that's only a hunch. |
Thank you, I will ping you as soon as I have something) Moving every preload to one file is kinda impossible with future plans of mine for this project (having a modular structure). I'll try examining other possibilities if there are any. I know that GUT had the same problem before v7, so I will try to dig into their project history to find how they solved this problem. |
So I finally got back to it and it seems that the error occurs even if you don't launch the game itself. It is sufficient to run the project in the editor, then close the editor and leak will appear. If I run the game directly or through the editor I see no leaks at the exit (except when I exit the editor then it's all back). So I wonder if godot editor does some optimization and loads autoload singetons event before game is ran to make game start faster and doesn't free them later. (Tested on 3.2.3 and 3.3.2) I tried doing anything inside |
While looking up the code to better understand how to use the plugin, the editor notified me about an error on |
This seems to be GUT's overview of memory management from 7.0: https://github.com/bitwes/Gut/wiki/Memory-Management They have a nice writeup on memory management in godot (not specific to GUT) at the bottom. You might have already seen this though. Figured I'd pull it into the conversation though. I spent a few hours yesterday trying to resolve this issue. I seemed to be able to get rid of some of the leaks by changing several classes that were using |
Thanks for investigating, @ryan-linehan, I've already seen that docs. Seems strange to me how is that godot has resources with reference counters but it cannot free them on exit. Using loads instead of preloads is not a bad option. I used const preloads because initially I thought it would give better startup performance. But knowing where I want to head development of this project this wont help much and is not very possible with modular structure so we can try investigating this further. |
Godot version: v3.2.3.stable.mono.official
godot-console version: 3.1.3
OS/device: macOS 10.14.6, MacBook Pro (2017)
Issue description:
When exiting a project with godot-console enabled, there are many ObjectDB instance leaks.
Steps to reproduce:
Minimal reproduction project and log output:
console_test.zip
log_output.txt
The text was updated successfully, but these errors were encountered: