I posted this problem before, but got no response.  I&#39;ve slightly modified my test program to illustrate the problem more clearly.  Specifically, when I run the below code on Windows 7 compiled with MSVC 2008 in 32 bit with Qt 4.7.4 and VTK pulled from git master on March 5, 2012, I get a pretty pronounced memory leak.  As I mouse over the image, then memory in the Windows Task Manager climbs.  If I comment out the imageViewer-&gt;Render(); line then the memory stays constants.<div>
<br></div><div>Can someone please</div><div>1.  Verify that they see this on their machine as well</div><div>2.  Provide a way to fix it.</div><div><br></div><div>Thanks</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px">
<span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;QtGui/QApplication&gt;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;QMainWindow&gt;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;QVTKWidget2.h&gt;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;vtkImageViewer2.h&gt;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;vtkImageData.h&gt;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;vtkPointData.h&gt;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#000080">#include</span><span style="color:#c0c0c0"> </span><span style="color:#008000">&lt;vtkGenericOpenGLRenderWindow.h&gt;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#808000">class</span><span style="color:#c0c0c0"> </span><span style="color:#800080">MyQVTKWidget2</span><span style="color:#c0c0c0"> </span>:<span style="color:#c0c0c0"> </span><span style="color:#808000">public</span><span style="color:#c0c0c0"> </span><span style="color:#800080">QVTKWidget2</span><span style="color:#c0c0c0"> </span>{</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#808000">public</span>:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#800080">MyQVTKWidget2</span><span style="color:#c0c0c0"> </span>(<span style="color:#800080">vtkImageViewer2</span><span style="color:#c0c0c0"> </span>*imageViewer,<span style="color:#c0c0c0"> </span><span style="color:#800080">QWidget</span><span style="color:#c0c0c0"> </span>*parent<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>)<span style="color:#c0c0c0"> </span>:<span style="color:#c0c0c0"> </span><span style="color:#800080">QVTKWidget2</span>(parent)<span style="color:#c0c0c0"> </span>{</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span><span style="color:#808000">this</span>-&gt;<span style="color:#800000">imageViewer</span><span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>imageViewer;</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">virtual</span><span style="color:#c0c0c0"> </span>~<span style="font-style:italic">MyQVTKWidget2</span>()<span style="color:#c0c0c0"> </span>{</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span><span style="color:#800000">imageViewer</span>-&gt;<span style="font-style:italic">Delete</span>();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">void</span><span style="color:#c0c0c0"> </span><span style="font-style:italic">mouseMoveEvent</span>(<span style="color:#800080">QMouseEvent</span><span style="color:#c0c0c0"> </span>*)<span style="color:#c0c0c0"> </span>{</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span><span style="color:#808000">for</span><span style="color:#c0c0c0"> </span>(<span style="color:#808000">int</span><span style="color:#c0c0c0"> </span>i=<span style="color:#000080">0</span>;<span style="color:#c0c0c0"> </span>i&lt;<span style="color:#000080">1000</span>;<span style="color:#c0c0c0"> </span>++i)<span style="color:#c0c0c0"> </span>{</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span><span style="color:#008000">//</span><span style="color:#c0c0c0"> </span><span style="color:#008000">Comment</span><span style="color:#c0c0c0"> </span><span style="color:#008000">out</span><span style="color:#c0c0c0"> </span><span style="color:#008000">these</span><span style="color:#c0c0c0"> </span><span style="color:#008000">lines</span><span style="color:#c0c0c0"> </span><span style="color:#008000">to</span><span style="color:#c0c0c0"> </span><span style="color:#008000">see</span><span style="color:#c0c0c0"> </span><span style="color:#008000">the</span><span style="color:#c0c0c0"> </span><span style="color:#008000">memory</span><span style="color:#c0c0c0"> </span><span style="color:#008000">stay</span><span style="color:#c0c0c0"> </span><span style="color:#008000">constant</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">            </span><span style="color:#800000">imageViewer</span>-&gt;<span style="font-style:italic">Render</span>();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">        </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#808000">private</span>:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#800080">vtkImageViewer2</span><span style="color:#c0c0c0"> </span>*<span style="color:#800000">imageViewer</span>;</pre>

<pre style="margin-top:0px;margin-bottom:0px">};</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#808000">int</span><span style="color:#c0c0c0"> </span>main(<span style="color:#808000">int</span><span style="color:#c0c0c0"> </span>argc,<span style="color:#c0c0c0"> </span><span style="color:#808000">char</span><span style="color:#c0c0c0"> </span>*argv[])<span style="color:#c0c0c0"> </span>{</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#800080">QApplication</span><span style="color:#c0c0c0"> </span>a(argc,<span style="color:#c0c0c0"> </span>argv);</pre>

<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#800080">vtkImageData</span><span style="color:#c0c0c0"> </span>*imageData<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#800080">vtkImageData</span>::New();</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>imageData-&gt;<span style="font-style:italic">SetExtent</span>(<span style="color:#000080">0</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">100</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">100</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">100</span>);</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>imageData-&gt;<span style="font-style:italic">SetOrigin</span>(<span style="color:#000080">0</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>);</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>imageData-&gt;<span style="font-style:italic">SetSpacing</span>(<span style="color:#000080">1</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">1</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">1</span>);</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>imageData-&gt;<span style="font-style:italic">AllocateScalars</span>();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>imageData-&gt;GetPointData()-&gt;GetScalars()-&gt;<span style="font-style:italic">FillComponent</span>(<span style="color:#000080">0</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>);</pre>

<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#800080">vtkImageViewer2</span><span style="color:#c0c0c0"> </span>*imageViewer<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#800080">vtkImageViewer2</span>::New();</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>imageViewer-&gt;<span style="font-style:italic">SetInput</span>(imageData);</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#800080">MyQVTKWidget2</span><span style="color:#c0c0c0"> </span>*widget<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#808000">new</span><span style="color:#c0c0c0"> </span><span style="color:#800080">MyQVTKWidget2</span>(imageViewer);</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>imageViewer-&gt;<span style="font-style:italic">SetRenderWindow</span>(widget-&gt;<span style="font-style:italic">GetRenderWindow</span>());</pre>

<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#800080">QMainWindow</span><span style="color:#c0c0c0"> </span>mainWindow;</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>mainWindow.setGeometry(<span style="color:#000080">200</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">200</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">300</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">300</span>);</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>mainWindow.setCentralWidget(widget);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>mainWindow.show();</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span>imageData-&gt;<span style="font-style:italic">Delete</span>();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">return</span><span style="color:#c0c0c0"> </span>a.exec();</pre>
<pre style="margin-top:0px;margin-bottom:0px">}</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif">Here is the Qt .pro file as well if it helps</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000">#-------------------------------------------------</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000">#</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000">#</span><span style="color:#c0c0c0"> </span><span style="color:#008000">Project</span><span style="color:#c0c0c0"> </span><span style="color:#008000">created</span><span style="color:#c0c0c0"> </span><span style="color:#008000">by</span><span style="color:#c0c0c0"> </span><span style="color:#008000">QtCreator</span><span style="color:#c0c0c0"> </span><span style="color:#008000">2012-02-24T13:30:58</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000">#</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000">#-------------------------------------------------</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">QT</span><span style="color:#c0c0c0">       </span>+=<span style="color:#c0c0c0"> </span>core<span style="color:#c0c0c0"> </span>opengl<span style="color:#c0c0c0"> </span>gui</pre>

<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">TARGET</span><span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>QVTKWidget2Test</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">CONFIG</span><span style="color:#c0c0c0">   </span>+=<span style="color:#c0c0c0"> </span>console</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">CONFIG</span><span style="color:#c0c0c0">   </span>-=<span style="color:#c0c0c0"> </span>app_bundle</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">TEMPLATE</span><span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>app</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">SOURCES</span><span style="color:#c0c0c0"> </span>+=<span style="color:#c0c0c0"> </span>main.cpp</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">LIBS</span><span style="color:#c0c0c0">    </span>+=<span style="color:#c0c0c0"> </span>-L../../vtk/lib<span style="color:#c0c0c0"> </span>-lvtkCommon<span style="color:#c0c0c0"> </span>-lvtksys<span style="color:#c0c0c0"> </span>-lQVTK\</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>-lvtkViews<span style="color:#c0c0c0"> </span>-lvtkWidgets<span style="color:#c0c0c0"> </span>-lvtkInfovis<span style="color:#c0c0c0"> </span>-lvtkRendering<span style="color:#c0c0c0"> </span>-lvtkGraphics<span style="color:#c0c0c0"> </span>-lvtkImaging<span style="color:#c0c0c0"> </span>-lvtkIO<span style="color:#c0c0c0"> </span>-lvtkFiltering\</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>-lvtklibxml2<span style="color:#c0c0c0"> </span>-lvtkDICOMParser<span style="color:#c0c0c0"> </span>-lvtkpng<span style="color:#c0c0c0"> </span>-lvtkpng<span style="color:#c0c0c0"> </span>-lvtktiff<span style="color:#c0c0c0"> </span>-lvtkzlib<span style="color:#c0c0c0"> </span>-lvtkjpeg<span style="color:#c0c0c0"> </span>-lvtkalglib<span style="color:#c0c0c0"> </span>-lvtkexpat\</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>-lvtkverdict<span style="color:#c0c0c0"> </span>-lvtkmetaio<span style="color:#c0c0c0"> </span>-lvtkNetCDF<span style="color:#c0c0c0"> </span>-lvtksqlite<span style="color:#c0c0c0"> </span>-lvtkexoIIc<span style="color:#c0c0c0"> </span>-lvtkftgl<span style="color:#c0c0c0"> </span>-lvtkfreetype<span style="color:#c0c0c0"> </span>-lvtkHybrid\</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>-lvtkVolumeRendering</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">INCLUDEPATH</span><span style="color:#c0c0c0"> </span>+=<span style="color:#c0c0c0"> </span>../vtk/include</pre><br>
<pre style="margin-top:0px;margin-bottom:0px"></pre></pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre></div>