-
Notifications
You must be signed in to change notification settings - Fork 2
Fix memory leaks #149
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
base: master
Are you sure you want to change the base?
Fix memory leaks #149
Conversation
|
WIP suppressions list to reduce noise in the valgrind output (this may suppress genuine errors in our code, but I'm fairly confident it doesn't) Which results in: Remaining erros look to be mostly imgui/fontconfig related with flamegpu functions in the stack trace (at a glance, I've not checked all 1765 loss records / 359 entries in the remainig valgrind log). A large number (of still reachables) may dissapear if we explciitly cleanup font config (just need to find the right place to call the appropriate method) Some still-reachables in SDL2 that may be unavoidable/need suppressing. |
|
I've copied the updated Text.cpp over to my model. It has fixed the issue I was seeing, the host memory during the simulation and afterwards while the window is open is now stable rather than increasing. If I can help by trying anything else out as you look at the remaining leaks let me know. Many thanks, David |
This causes (some?) reiniitalisation of font config on each font search, but fixes (some) font config leaks
… merge. This should probably be in a visualiser cleanup method, but one does not exist.
Thanks for confirming the main leak is fixed, I'll let you know if there's anything else for you to check. There are some reported dbus leaks via SDL2, but googling suggests these are won't fix upstream, so we can probably just suppress those, and other There's some leakage in the usage of fontconfig in There are also some leaks due to certain imgui and SDL cleanup methods not being called depedning on the current state of the UI window (due to multithreaded rendering). I.e. Manually closing the visualiser window when With the extra suppressions, fixes and visualistion thread joining, the summary for my case is now: The remaining definite loss is:
That implementation probably needs to move to the header? Of the remaining still reachables, a number can be suppressed (nvrtc, dl_open?), but I'll have to follow up with this another day. It may also be worth having a better look at the SDL2 suppressed leaks, and also running valgrind over our non-visualisation test suite. |
Presumably this could be removed instead, seeing as TextureBuffer.h must never be seen by nvcc
|
With the following probably slightly too broad suppressions list, the and 2 errors in libraries Suppression usage is mostly in cuda/nvidia bits, but it may be worht cehcking the suppressed sdl2 leask more thoroughly, though perhaps this should be defferred to a future issue to get the in-render loop fixes merged in. |
Robadob
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid in principle, added a couple of comments on the things that might be worth reviewing closer.
Sorry about the delay, found it as an unread email in my inbox which had fell off my radar.
Fixes memory leaks in the visualiser, originally identified by @DavidFletcherShef in #148.
Text::setStringfreeinText::textureString::resizeFcConfigDestroyis calledFcFiniin~VisualiserHUD::Itemfor a missingfreeTextureBuffer.h(which never gets triggered anyway)Visualiser::closeEntity::needsExportto false (matching debug build behaviour)ImGuiPanel::first_renderto0