Skip to content
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

Various memory leaks #238

Open
wheybags opened this issue Jan 11, 2015 · 3 comments
Open

Various memory leaks #238

wheybags opened this issue Jan 11, 2015 · 3 comments

Comments

@wheybags
Copy link
Member

@dwimsey Getting a bunch of memory leaks from valgrind in my project, made a minimal example which exhibits the same behaviour, by editing Samples/pyinvaders/src/main.cpp to: https://gist.github.com/wheybags/802237fb51fa63af22c5 (removes the whole game + just loads one rml document) + copying in the rml from samples/tutorial/template.
This gives the following errors in valgrind: https://gist.github.com/wheybags/ddfa929632fcf733059e and https://gist.github.com/wheybags/29e3af2995bff44a0892 with --show-leak-kinds=all
These leaks only seem to show up when python is enabled.
Just wanted to confirm that these aren't false positives. I can start going through the source trying to fix these leaks (ugh), if needs be.

@wheybags
Copy link
Member Author

Or an I just not cleaning up properly?

@dwimsey
Copy link
Member

dwimsey commented Jan 11, 2015

I can’t give you a solid answer on that. I can think of a couple reasons while valgrind might get confused:

Python objects get attached to the RML objects and stick around until the RML objects have been deleted and a GC collection is done, I don’t know if python does a GC collection on exit or it just quits. I would expect it to do a collection so all resources can be closed properly rather than just terminated. In Lua, some objects stick around even after the RML has been destroyed because of references to them in the Lua code that hasn’t been GC’d yet, have no idea if the Python code has the same sort of relationship mapping issue.

I do remember at one point that the python library itself complained about memory leaks when exiting but my recollection of those leaks was that they were somewhat global objects that didn’t seem to be a big concern as they wouldn’t bloat over time, just globals that didn’t get cleaned up on exit properly. I could be remembering it entirely wrong.

I’m certain SOME of those leaks are actually leaks, if not all. Valgrind is generally right in my experience … not always, but pretty close.

On Jan 11, 2015, at 2:26 PM, Tom Mason notifications@github.com wrote:

@dwimsey https://github.com/dwimsey Getting a bunch of memory leaks from valgrind in my project, made a minimal example which exhibits the same behaviour, by editing Samples/pyinvaders/src/main.cpp to: https://gist.github.com/wheybags/802237fb51fa63af22c5 https://gist.github.com/wheybags/802237fb51fa63af22c5 (removes the whole game + just loads one rml document) + copying in the rml from samples/tutorial/template.
This gives the following errors in valgrind: https://gist.github.com/wheybags/ddfa929632fcf733059e https://gist.github.com/wheybags/ddfa929632fcf733059e and https://gist.github.com/wheybags/29e3af2995bff44a0892 https://gist.github.com/wheybags/29e3af2995bff44a0892 with --show-leak-kinds=all
These leaks only seem to show up when python is enabled.
Just wanted to confirm that these aren't false positives. I can start going through the source trying to fix these leaks (ugh), if needs be.


Reply to this email directly or view it on GitHub #238.

@wheybags
Copy link
Member Author

There are a bunch of false positives generated by pythons internal memory allocator, but I'm suppressing those. I guess I'll have to look further into these leaks
/me sighs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants