memory leak? help

Heather Drury heather at v1.wustl.edu
Wed Jul 21 17:49:40 EDT 1999


Hi,

I've written a vtk (using python) application that permits
volume/slice visualization of multiple volumes. 
I've run into what appears to be a major memory leak
that I'm having difficulty isolating. 

I don't think I quite understand what I have to do to free 
up memory in vtk...The VTK book talks briefly
about reference counting (p 562) but I'm not clear whether
I have to explicitly Delete objects myself or does vtk
do that when the reference count drops to zero?

When I run my program and read one volume (19 meg) in 
over and over again I see:

	before I start application	350 meg free
	start application		342 
	read volume 1			284
	re-read volume 1		229	
	re-read volume 1		192	
	re-read volume 1		173	
	re-read volume 1		155	

Eventually, the program crashes. Basically, at each reading
the data is read in (to replace the previous volume) and three 
orthogonal slice views are created (using vtkImageImport, 
vtkImageReslice, vtkTexture, vtkActor, etc.). What do I need to 
do to free up the memory used by these functions? 

I've tried to use to Delete operation (on for example, the Actor),
but I get an "AttributeError" messages.

Obviously I don't really know what I'm doing here, so
any hints/suggestions/pointers would be greatly appreciated.

TIA,

heather

Heather Drury                               	heather at v1.wustl.edu 
Washington University School of Medicine    	http://v1.wustl.edu	
Department of Anatomy & Neurobiology         	Phone: 314-362-4325
660 S. Euclid, MS 8108                       	FAX: 314-747-4370
St. Louis, MO 63110-1093


-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list