[vtkusers] Does VTK have higher memory usage in python

Bryn Lloyd lloyd at itis.ethz.ch
Thu Oct 27 06:12:21 EDT 2011


OK. Thanks.

 

I guess following this, I should also connect the reader and not do this:

 

input = reader.GetOutput()

 

 

 

From: Jothybasu Selvaraj [mailto:jothybasu at gmail.com] 
Sent: Thursday, October 27, 2011 12:09 PM
To: Bryn Lloyd
Cc: vtk
Subject: Re: [vtkusers] Does VTK have higher memory usage in python

 

Use clip.SetInputConnection(input.GetOutputPort()).

Otherwise it will make a copy of the input foe each iteration!

Jothy

On Thu, Oct 27, 2011 at 11:04 AM, Bryn Lloyd <lloyd at itis.ethz.ch> wrote:

Is the memory usage higher in python than in C++?

 

I am not sure, but am having issues with large memory usage for simple
things like clipping a large dataset.

 

My system memory usage is around 20GB, the dataset on file is "only" 2GB.

 

The pipeline looks like this: reader->clip polydata->writer

 

 

How can I reduce the memory footprint? Here is some example code:

 

reader = vtkXMLPolyDataReader()

reader.SetFileName(ifname)

reader.Update()

input = reader.GetOutput()

 

# do multiple clips

for k in range(10):

                # compute implicit box (not shown)

                clip = vtkClipPolyData()

                clip.SetClipFunction(box)

                clip.SetInput(input)

                

                fnameo = bnameo + "_clipped%05d.vtp" % k

                writer = vtkXMLPolyDataWriter()

                writer.SetInput(clip.GetOutput())

                writer.SetFileName(fnameo)

                writer.SetDataModeToAppended()

                writer.SetEncodeAppendedData(0)

                writer.Write()

 

 

Thanks

Bryn

 


_______________________________________________
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 VTK FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers




-- 

Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111027/cd9667a3/attachment.htm>


More information about the vtkusers mailing list