<div dir="ltr"><div><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hi list,</span></div><div><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The issue was resolved thanks to an intense debugging session.</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">This is a Qt issue, caused by our usage of QVTKOpenGLWindow and windowContainer.</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The leak was caused by NULL parenting the parent of the windowContainer containing the QVTKOpenGLWindow just before deletion.</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">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.</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">This leak shouldn't happen though, even in this situation, so I have opened a Qt<span> </span></span><a href="https://bugreports.qt.io/browse/QTBUG-69429" target="_blank" rel="nofollow" style="color:rgb(83,129,172);text-decoration:none;font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250)">issue</a><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>to report it.</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Sorry for the noise, as Xorg is probably not to blame.</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;text-align:left;background-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mathieu Westphal<br></div></div></div>
<br><div class="gmail_quote">On Tue, Jul 3, 2018 at 8:14 AM, Mathieu Westphal <span dir="ltr"><<a href="mailto:mathieu.westphal@kitware.com" target="_blank">mathieu.westphal@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Dennis, Aaron,<div><br></div><div>Firstly, Dennis, you may have missed that it is <b>Xorg </b>leaking in the <b>VRAM </b>and not releasing it<b> </b>even<b> after my application is exited</b>/killed completely.</div><div>I have been monitoring the RAM as well, it is fine and my application is not leaking but somehow forces Xorg to allocate graphical memory that never gets released.</div><div class="gmail_extra"><div class="gmail_quote"><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span> <br>
</span>> I think you are looking at output from an nvidia tool and not memory<br>
> for the system and processes as a whole.<br></blockquote></span><div>I'm using nvidia-smi as it is available on all system with the nvidia driver</div><div>I actually see the same behavior monitoring <a href="https://www.khronos.org/registry/OpenGL/extensions/NVX/NVX_gpu_memory_info.txt" target="_blank">NVX_gpu_memory_info</a><wbr> manually</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Based on Mathieu's email subject, it sounds like he's interested in how<br>
much GPU memory Xorg is using. The process data in /proc does not<br>
include GPU memory.<br></blockquote></span><div>Indeed</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Mathieu, when you say memory is leaked, do you mean that the memory<br>
usage increases each time you run myOpenGLQtBasedApp, or does it<br>
increase from 50 MB to 110 MB and then stay there even if you run the<br>
app again?<br></blockquote></span><div>Each time I run and open/close QOpenGLWindow based widget, the graphical memory usage</div><div>increase by 4Mb until it reaches 96% of the availlable VRAM.</div><div>It then actually starts to leak on RAM by a mechanism I just learned about (eviction)</div><div>And then, once the RAM is full, OpenGL fails completelly.</div><span class=""><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
You can diagnose which clients are causing the server to allocate<br>
resources by running tools such as xrestop, xwininfo -tree -root, and<br>
xlsclients before and after running your app each time.<br></blockquote></span><div>Here are my results on a test run using Xfce with compositor enabled.</div><div>nvidia-smi shows a 61Mb leak</div><div><br></div><div>xlsclient -l and xwininfo -tree -root outputs are strictly identical before and after.</div><div>xrestop -b shows a slight increase of lees than a Mb all process additionned.</div><div>(see attached)</div><div><br></div><div>Note : Even after multiples runs and hundreds Mb of memory leaked reported by nvidia-smi,</div><div>xrestop total memory usage does not increase.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If you're still having trouble, you can email <a href="mailto:linux-bugs@nvidia.com" target="_blank">linux-bugs@nvidia.com</a> and<br>
we can try to help you out there.<br></blockquote></span><div>I definitely will if we can't figure out what is going on.</div><div><br></div><div>Best regards,</div><div> </div></div><br></div></div>
</blockquote></div><br></div>