<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
I think you need more than what's reported in the WTM to be sure that memory has actually leaked.<br><br>Xiaofeng <br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Fri, 27 Apr 2012 09:46:01 -0700<br>Subject: Re: [vtkusers] Potential memory leak on render<br>From: jonmorra@gmail.com<br>To: xf10036@hotmail.com<br>CC: vtkusers@vtk.org<br><br><div class="ecxgmail_extra">&nbsp;I tested all these memory problems by putting a break point on the return0; line and noting the memory in the Windows Task Manager.&nbsp;<br><br><div class="ecxgmail_quote">On Fri, Apr 27, 2012 at 9:46 AM, Xiaofeng Z <span dir="ltr">&lt;<a href="mailto:xf10036@hotmail.com">xf10036@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">How did you measure the memory usage?<br>
<div><div class="h5"><br>
On Apr 27, 2012, at 12:23 PM, "Jonathan Morra" &lt;<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>&gt; wrote:<br>
<br>
&gt; I'm running the following code on Windows 7 (both x86 and x64), and have noticed the following memory usages. &nbsp;I think this implies some memory leak in the render call to VTK. &nbsp;Can someone please let me know if they see this as well, and if so how to fix it.<br>

&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; Here are my results<br>
&gt; 0 Renders -- 9.852 M<br>
&gt; 1 Render -- 29.28 M (I'm not sure if this jump is to be expected)<br>
&gt; 10 Renders -- 29.76 M<br>
&gt; 100 Renders -- 30.404 M<br>
&gt; 1000 Renders -- 31.172 M<br>
&gt; 10000 Renders -- 36.56 M<br>
&gt; 100000 Renders -- 44.276 M<br>
&gt;<br>
&gt; Here is the code<br>
&gt;<br>
&gt; //<b> I tested all these memory problems by putting a break point on the return0; line and noting the memory in the Windows Task Manager.</b><br>
&gt; int main(int argc, char *argv[]) {<br>
&gt; &nbsp;vtkSmartPointer&lt;vtkImageData&gt; imageData =<br>
&gt; &nbsp; &nbsp;vtkSmartPointer&lt;vtkImageData&gt;::New();<br>
&gt; &nbsp;imageData-&gt;SetExtent(0, 100, 0, 100, 0, 100);<br>
&gt; &nbsp;imageData-&gt;SetOrigin(0, 0, 0);<br>
&gt; &nbsp;imageData-&gt;SetSpacing(1, 1, 1);<br>
&gt; &nbsp;imageData-&gt;AllocateScalars();<br>
&gt; &nbsp;imageData-&gt;GetPointData()-&gt;GetScalars()-&gt;FillComponent(0, 0);<br>
&gt; &nbsp;vtkSmartPointer&lt;vtkImageViewer2&gt; imageViewer =<br>
&gt; &nbsp; &nbsp;vtkSmartPointer&lt;vtkImageViewer2&gt;::New();<br>
&gt; &nbsp;imageViewer-&gt;SetInput(imageData);<br>
&gt; &nbsp;int numRenders = 100000;<br>
&gt; &nbsp;for (int i=0; i&lt;numRenders; ++i) {<br>
&gt; &nbsp; &nbsp;imageViewer-&gt;Render();<br>
&gt; &nbsp;}<br>
&gt; &nbsp;return 0;<br>
&gt; }<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div></div>                                               </div></body>
</html>