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.
I can already download ParaView 3.6? Great, I did not know this!
thx,
Natalie
> Date: Fri, 17 Jul 2009 08:47:37 -0400
> Subject: Re: [Paraview] memory leak in writer
> From: utkarsh.ayac...@kitware.com
> To: natalieh...@hotmail.com
> CC: paraview@paraview.org
>
> Out of curiosity, why are you writing your own wrapper? ParaView 3.6
> onwards supports writing time series for legacy vtk files.
>
> Utkarsh
>
> On Fri, Jul 17, 2009 at 7:53 AM, Natalie
> Happenhofer<natalieh...@hotmail.com> wrote:
> > Hi!
> > I´ve written a Wrapper for the Legacy VTK files writer, so that it writes a
> > whole timeseries if I want it to. Lamentably, applying it, it needs more and
> > more memory, so I am looking for a memory leak.
> >
> > Here is the bit of code I suspect:
> >
> > vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
> > vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT());
> >
> > vtkSmartPointer<vtkDataObject> inputCopy;
> > inputCopy.TakeReference(input->NewInstance());
> > inputCopy->ShallowCopy(input);
> >
> > vtksys_ios::ostringstream fname;
> > if (this->WriteAllTimeSteps)
> > {
> > vtkstd::string path =
> > vtksys::SystemTools::GetFilenamePath(this->FileName);
> > vtkstd::string fnamenoext =
> > vtksys::SystemTools::GetFilenameWithoutLastExtension(this->FileName);
> > vtkstd::string ext =
> > vtksys::SystemTools::GetFilenameLastExtension(this->FileName);
> > if((this -> CurrentTimeIndex) < 10) fname << path << "/" << fnamenoext
> > << ".000" <<this->CurrentTimeIndex << ext;
> > else if((this -> CurrentTimeIndex) < 100) fname << path << "/" <<
> > fnamenoext << ".00" << this -> CurrentTimeIndex << ext;
> > else if((this -> CurrentTimeIndex) < 1000) fname << path << "/" <<
> > fnamenoext << ".0" << this -> CurrentTimeIndex << ext;
> > else fname << path << "/" << fnamenoext << this -> CurrentTimeIndex <<
> > ext;
> > }
> > else
> > {
> > fname << this->FileName;
> > }
> >
> > //Here I call the usual VTK Writer and set the input
> >
> > vtkGenericDataObjectWriter* Writer = vtkGenericDataObjectWriter::New();
> > Writer -> SetInput(inputCopy);
> > Writer -> SetFileName(fname.str().c_str());
> > if((this -> FileType) == 1) Writer -> SetFileTypeToASCII();
> > else Writer -> SetFileTypeToBinary();
> >
> > Writer -> Update();
> >
> > if (this->WriteAllTimeSteps)
> > {
> > this->CurrentTimeIndex++;
> > if (this->CurrentTimeIndex == this->NumberOfTimeSteps)
> > {
> > // Tell the pipeline to stop looping.
> >
> > request->Remove(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING());
> > this->CurrentTimeIndex = 0;
> > }
> > }
> >
> > Writer -> Delete();
> > return 1;
> >
> > Is there anything I forget to delete?
> >
> >
> > thx for answers
> > Natalie
> >
> >
> >
> > ________________________________
> > Nuevo Internet Explorer 8 ¡Es Gratis y optimizado para MSN!
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the ParaView Wiki at:
> > http://paraview.org/Wiki/ParaView
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.paraview.org/mailman/listinfo/paraview
> >
> >
_________________________________________________________________
Disfruta los mejores videos de MSN mientras chateas
http://messengertv.msn.com/mkt/es-xl/
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview