<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I have written it months ago and it worked well for small files and timeseries for about 30 files - I have just come across it trying to write a time series of 200 files. <br><br>I can already download ParaView 3.6? Great, I did not know this!<br><br>thx,<br>Natalie<br><br>> Date: Fri, 17 Jul 2009 08:47:37 -0400<br>> Subject: Re: [Paraview] memory leak in writer<br>> From: utkarsh.ayachit@kitware.com<br>> To: nataliehapp@hotmail.com<br>> CC: paraview@paraview.org<br>> <br>> Out of curiosity, why are you writing your own wrapper? ParaView 3.6<br>> onwards supports writing time series for legacy vtk files.<br>> <br>> Utkarsh<br>> <br>> On Fri, Jul 17, 2009 at 7:53 AM, Natalie<br>> Happenhofer<nataliehapp@hotmail.com> wrote:<br>> > Hi!<br>> > I´ve written a Wrapper for the Legacy VTK files writer, so that it writes a<br>> > whole timeseries if I want it to. Lamentably, applying it, it needs more and<br>> > more memory, so I am looking for a memory leak.<br>> ><br>> > Here is the bit of code I suspect:<br>> ><br>> > vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);<br>> > vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT());<br>> ><br>> > vtkSmartPointer<vtkDataObject> inputCopy;<br>> > inputCopy.TakeReference(input->NewInstance());<br>> > inputCopy->ShallowCopy(input);<br>> ><br>> > vtksys_ios::ostringstream fname;<br>> > if (this->WriteAllTimeSteps)<br>> > {<br>> > vtkstd::string path =<br>> > vtksys::SystemTools::GetFilenamePath(this->FileName);<br>> > vtkstd::string fnamenoext =<br>> > vtksys::SystemTools::GetFilenameWithoutLastExtension(this->FileName);<br>> > vtkstd::string ext =<br>> > vtksys::SystemTools::GetFilenameLastExtension(this->FileName);<br>> > if((this -> CurrentTimeIndex) < 10) fname << path << "/" << fnamenoext<br>> > << ".000" <<this->CurrentTimeIndex << ext;<br>> > else if((this -> CurrentTimeIndex) < 100) fname << path << "/" <<<br>> > fnamenoext << ".00" << this -> CurrentTimeIndex << ext;<br>> > else if((this -> CurrentTimeIndex) < 1000) fname << path << "/" <<<br>> > fnamenoext << ".0" << this -> CurrentTimeIndex << ext;<br>> > else fname << path << "/" << fnamenoext << this -> CurrentTimeIndex <<<br>> > ext;<br>> > }<br>> > else<br>> > {<br>> > fname << this->FileName;<br>> > }<br>> ><br>> > //Here I call the usual VTK Writer and set the input<br>> ><br>> > vtkGenericDataObjectWriter* Writer = vtkGenericDataObjectWriter::New();<br>> > Writer -> SetInput(inputCopy);<br>> > Writer -> SetFileName(fname.str().c_str());<br>> > if((this -> FileType) == 1) Writer -> SetFileTypeToASCII();<br>> > else Writer -> SetFileTypeToBinary();<br>> ><br>> > Writer -> Update();<br>> ><br>> > if (this->WriteAllTimeSteps)<br>> > {<br>> > this->CurrentTimeIndex++;<br>> > if (this->CurrentTimeIndex == this->NumberOfTimeSteps)<br>> > {<br>> > // Tell the pipeline to stop looping.<br>> ><br>> > request->Remove(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING());<br>> > this->CurrentTimeIndex = 0;<br>> > }<br>> > }<br>> ><br>> > Writer -> Delete();<br>> > return 1;<br>> ><br>> > Is there anything I forget to delete?<br>> ><br>> ><br>> > thx for answers<br>> > Natalie<br>> ><br>> ><br>> ><br>> > ________________________________<br>> > Nuevo Internet Explorer 8 ¡Es Gratis y optimizado para MSN!<br>> > _______________________________________________<br>> > Powered by www.kitware.com<br>> ><br>> > Visit other Kitware open-source projects at<br>> > http://www.kitware.com/opensource/opensource.html<br>> ><br>> > Please keep messages on-topic and check the ParaView Wiki at:<br>> > http://paraview.org/Wiki/ParaView<br>> ><br>> > Follow this link to subscribe/unsubscribe:<br>> > http://www.paraview.org/mailman/listinfo/paraview<br>> ><br>> ><br><br /><hr />¿Quieres conocerte mejor? <a href='http://www.descubrewindowslive.com/' target='_new'>¡Conoce lo que Windows Live tiene especialmente para ti!</a></body>
</html>