Xorg VRAM leak because of Qt/OpenGL Application
-
Please consider reporting this to https://bugreports.qt.io. Qt devs would appreciate a minimal compilable example together with the (splendid) data you've already provided.
-
@mwestphal if you have a commercial licence, then the support can help you with priblems in your code also.
if you use open source Qt, then you have to provide a minimal example for bug reports, i.e. track down the actual problem (which is always good!)
-
Since the whole application is OpenSource and Free, I do not have any problem with sharing it, it is simply that I am afraid that a example with this so many lines will not be considered and quite hard to pin down for somebody not knowing the code.
I was more hoping for advices on how this could happen as it would help me track it down.
-
@mwestphal said in Xorg VRAM leak because of Qt/OpenGL Application:
I was more hoping for advices on how this could happen as it would help me track it down.
I have zero experience with QOpenGLWidget and containerWidget, unfortunately.
One recommendation that springs to mind when leaks are a problem: run your app through
valgrind
and / or clang's address sanitizer. They are often quite good at finding such issues. -
Have you tried building your application with Address Sanitizer to see if it helps you identify the source of the leak? It is very helpful with that sort of problem.
-
@wrosecrans have you read the last two responses? ;)
-
D'oh. Maybe this plan to give up drinking so much coffee in the mornings wasn't such a great idea. :)
I guess I just think using Address Sanitizer is advice that is worth repeating! One thing I will add is that it's not clang specific -- recent versions of gcc will accept the same command line parameters to use it.
-
The issue was resolved thanks to an intense debugging session.
The leak was caused by NULL parenting the parent of the windowContainer containing the QVTKOpenGLWindow just before deletion.
This code was here before when we used a QOpenGLWidget and it caused no issue. In any case, NULL parenting a widget before deletion is useless so removing the line resolve the issue.
This leak shouldn't happen though, even in this situation, so I have opened a Qt issue to report it.
-
Great, thanks for investigating and reporting the bug!
-