Closed TheHiddenDuke closed 4 years ago
There hasn't been a leak in ImDrawList since release afaik - we only keep buffer allocated accross frames but that doesn't accumulate.
So your issue is either:
Note that you could perfectly run your loop without any of the GL/VX code, only NewFrame+Begin/End/DrawList stuff/Render at a much faster speed and confirm if you get a leak which would mean the issue is in 1) not in 2) or 3). Similarly to could skip the GL rendering completely (removed glClear, RenderDrawData, swapBuffer) etc.
Either way until proven it doesn't seem like some code in the dear imgui repository is faulty.
Thank you for a quick reply and a descriptive answer!
I forgot to mention that I did run ImGui on windows without any sign of the memory leak, as well as I checked the Metrics window and it kept the same values. So I also doubt that dear imgui is the reason.
I don't really know a lot about openGl and how it interacts with imgui. Would you have an idea of where to start looking?
I already mentioned a way to easily differentiate 2 from 3 which would narrow it down to either OpenGL driver behavior or VxWorks back-end behavior.
In both cases the problem is probably to be taken to the maker of that closed-source solution.
Closing this because out of our support scope.
Reverted the changes of #4468 with b8b0f9d, not using glBufferSubData() anymore. PLEASE REPORT IF YOU STILL HAVE ISSUES AFTER TODAY. I temporarily kept the alternative code path even though bd->UseBufferSubData is always false, allowing potential experiment shall new issues arises. Finger crossed this doesn't bite us back.
Version/Branch of Dear ImGui:
Version: 1.72 WIP Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl3.cpp Compiler: llvm Operating System: VxWorks 7
My Issue/Question:
I'm using the function to add primitives to the draw list for a single window. This renders the gui perfect, but there seems to be a memory leak as after 2 hours of running continuously the system crashes due to the lack of ram.
Here is the code used to initialize build up the screen. Only one window is used as a "canvas" to place all the primitives on. At most there is close to 300 objects that are drawn inside the draw_list.
Hope someone can give some insight!