I did some more testing and determined that with my script that there aren't any vtkObjects that aren't cleaned up after each call to the coprocessing library with your surfaceRep.py script. Basicaly I kept a counter in vtkObject that incremented for each constructor call and decremented for each destructor call. At the end of every call I had the same amount of vtkObjects. <br>
<br>After that I tried using valgrind to see if I could track it down any further. While there was some memory leaks reported, the amount didn't increase with the number of times the coprocessing pipeline was executed. Curiously though, valgrind did list an increase in the amount of memory that was leaked. It seemed like there were quite a few PyObjects that weren't getting deleted properly though and maybe getting rid of them properly would help. It may also be that memory fragmentation is a problem since rather large arrays are probably being allocated to for the field data as well as the opengl arrays (turning on immediate mode rendering would help with that but I'm not sure how to do that through the python but maybe someone else does). <br>
<br>Andy<br><br><div class="gmail_quote">On Tue, Jan 10, 2012 at 12:36 PM, Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I ran the problem out for more time steps and am now seeing the same trend. Hopefully it won't take too much effort to track this down.<br><font color="#888888"><br>Andy</font><div><div></div><div class="h5"><br><br>
<div class="gmail_quote">On Tue, Jan 10, 2012 at 12:09 PM, Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br><br>I'm trying to replicate it and with my scripts I'm getting the attached memory usage. I'm not seeing it though I may not be measuring memory very well or letting it play out long enough. I'll keep looking but it's possible that you're not deleting your created data object that is getting passed into the coprocessing library. That would be my first recommendation to check. You may want to turn on debug leaks if you haven't in your paraview build.<br>
<br>By the way, I generated that graph with the attached scripts.<br><font color="#888888"><br>Andy</font><div><div></div><div><br><br><div class="gmail_quote">2012/1/10 Takuya OSHIMA <span dir="ltr"><<a href="mailto:oshima@eng.niigata-u.ac.jp" target="_blank">oshima@eng.niigata-u.ac.jp</a>></span><br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi John,<br>
<br>
What I observed on a Mac and a Linux box with 8 processor parallel<br>
runs (around 400MB per process) were quite similar to your memory<br>
profiling but with a bit larger growth rate of 1-2% and 2-3% per<br>
coprocessing execution respectively (somehow it was bigger on Linux).<br>
I'll see if I can do similar profiling.<br>
<div><br>
Takuya OSHIMA, Ph.D.<br>
Faculty of Engineering, Niigata University<br>
8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN<br>
<br>
</div>From: "Biddiscombe, John A." <<a href="mailto:biddisco@cscs.ch" target="_blank">biddisco@cscs.ch</a>><br>
Subject: RE: [Paraview] Unreclaimed memory in coprocessing? (PV 3.12.0 and git-master)<br>
Date: Tue, 10 Jan 2012 14:51:41 +0000<br>
<div><br>
> Takuya<br>
><br>
> Running a test of coprocessing on a very small simulation using just 2 cores<br>
> on the desktop, I am seeing what looks like a very small leak. Over about 30<br>
> iterations, it’s of the order of 30MB, so might not be real (need to test on a<br>
> bigger domain to see if it grows faster), but the trend looks credible. I’ll<br>
> see if I can pinpoint where the loss is occurring.<br>
><br>
> JB<br>
><br>
</div>> [cid]<br>
<div><div></div><div>><br>
> -----Original Message-----<br>
> From: <a href="mailto:paraview-bounces@paraview.org" target="_blank">paraview-bounces@paraview.org</a> [mailto:<a href="mailto:paraview-bounces@paraview.org" target="_blank">paraview-bounces@paraview.org</a>] On<br>
> Behalf Of Takuya OSHIMA<br>
> Sent: 10 January 2012 15:11<br>
> To: <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><br>
> Subject: Re: [Paraview] Unreclaimed memory in coprocessing? (PV 3.12.0 and<br>
> git-master)<br>
><br>
> Attached in the previous mail is a sample Python coprocessing script that<br>
> exhibits the problem (written by the coprocessing script generator of<br>
> git-master as of today).<br>
><br>
> Takuya<br>
><br>
> Takuya OSHIMA, Ph.D.<br>
><br>
> Faculty of Engineering, Niigata University<br>
><br>
> 8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN<br>
><br>
> From: Takuya OSHIMA <<a href="mailto:oshima@eng.niigata-u.ac.jp" target="_blank">oshima@eng.niigata-u.ac.jp</a>><br>
><br>
> Subject: Unreclaimed memory in coprocessing? (PV 3.12.0 and git-master)<br>
><br>
> Date: Tue, 10 Jan 2012 23:08:21 +0900 (JST)<br>
><br>
> > Hi,<br>
><br>
> ><br>
><br>
> > I am having a problem where the memory usage of my simulation program<br>
><br>
> > which links with the PV coprocessing library grows until it gets<br>
><br>
> > killed by the operating system.<br>
><br>
> ><br>
><br>
> > I have the following piece of code for triggering coprocessing and if<br>
><br>
> > I watch the memory usage with the ps/top commands it grows only at the<br>
><br>
> > timestep where this->Processor->CoProcess() is called. My simulation<br>
><br>
> > program uses vtkImageData as underlying data structure so no data<br>
><br>
> > format adaptation (that may involve allocating extra memory for data<br>
><br>
> > copy) is performed.<br>
><br>
> ><br>
><br>
> > this->DataDescription->SetTimeData(this->TimeInfo->GetTimeValue(),<br>
><br>
> > this->TimeInfo->GetTIter());<br>
><br>
> > if (this->Processor->RequestDataDescription(this->DataDescription))<br>
><br>
> > {<br>
><br>
> > vtkCPInputDataDescription *idd<br>
><br>
> > = this->DataDescription->GetInputDescriptionByName("input");<br>
><br>
> > // obtain vtkImageData to coprocess from my simulation program<br>
><br>
> > vtkImageData *grid = this->TimeInfo->GetGrid();<br>
><br>
> > idd->SetWholeExtent(grid->GetWholeExtent());<br>
><br>
> > idd->SetGrid(grid);<br>
><br>
> > // now call the coprocessing library<br>
><br>
> > this->Processor->CoProcess(this->DataDescription);<br>
><br>
> > }<br>
><br>
> ><br>
><br>
> > Besides, the Apple's "leaks" tool shows no meaningful leaks which<br>
><br>
> > makes me wonder if e.g. there are un-unregistered proxies than simply<br>
><br>
> > unmatched New()/Delete() or new/delete pairs.<br>
><br>
> ><br>
><br>
> > The problem is same for PV 3.12.0 and the git master as of today.<br>
><br>
> > Is anybody else having the problem? Any ideas?<br>
><br>
> ><br>
><br>
> > Thanks,<br>
><br>
> > Takuya<br>
><br>
> ><br>
><br>
> > Takuya OSHIMA, Ph.D.<br>
><br>
> > Faculty of Engineering, Niigata University<br>
><br>
> > 8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN<br>
><br>
> _______________________________________________<br>
><br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/" target="_blank">http://www.kitware.com/opensource/</a><br>
> opensource.html<br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at: http://<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
><br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
> *<br>
><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
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>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>