-
Notifications
You must be signed in to change notification settings - Fork 38
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
memory leaks when closing the game window in different ways #653
Comments
If you start godot in a terminal it will print out which instances leaked. That helped me find an annoying leak I had with the My plan was to revisit the leaks once the rewrite of the memory manager is done: #618 |
EDIT: thinking a bit more about it, I start godot by redirecting it's output to a log file but I guess my game doesn't start with this redirection, so I need to dig a bit into it and find out how to start the game with the output redirected to my log. @jsbeckr yes the prob is that it doesn't say even at the console. I just run godot from the console, run my game, pressed cmd-Q , crash with the popup with jvm leaks, nothing in the console. But I get this from the OS crash window:
|
I've redirected the in-game godot log to /tmp/godot.log but it doesn't print any leaks when I cmd-Q:
|
ah okay... on Linux it looks like this
Of course it could be a totally different issue. |
@jsbeckr hmm, ok I commented out some code of mine that queueFree's some nodes that I dynamically instantiate just to simulate a leak. It didn't log them:
So maybe this happens only on macos? |
Ok got some advice on how to get the leaks into my log and now I can see this when pressing CMD-Q:
I would guess that InputEventKey to be the cmd-q itself, I just run the app and straight away press CMD-Q. My only input handler is not storing any events anywhere (it is for the cam and handles some mouse events), so not sure why that is. I'll put it into my bug entry. It replicates easily by just starting the game and pressing cmd-q. Note that when I press an "Exit" button that I have in my game that does |
A bit more info: today I tried to make "ESC" quit my game. But I get the same memory leak for the InputEventKey:
log:
|
one more when changing material. Maybe not multi-threading related:
|
I've noticed memory leaks when pressing cmd-q (on macos), less memory leaks when closing the game window and no memory leaks if I add a button that does
get_tree().quit()
when pressed.I am not sure what is the issue. I have some cleanup code in a function and in all cases my cleanup function is called (I have a GD.print and can see the output). But especially cmd-q almost always results in a memory leak. I am not sure if it is a bug or if it is a problem of my code. But I would think since my cleanup() is called in all cases and no leaks happen when I close the game by pressing my button that does the
get_tree().quit()
, it has to do with the handlers of window-close or cmd-q events.The text was updated successfully, but these errors were encountered: