[vtkusers] Does VTK have higher memory usage in python

Bryn Lloyd lloyd at itis.ethz.ch
Thu Oct 27 06:04:13 EDT 2011


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

 

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


More information about the vtkusers mailing list