[vtkusers] VTK and Garbage Collection

Jeff Lee jeff at cdnorthamerica.com
Thu May 29 09:19:54 EDT 2003


can you post a code snippet of how you use SwingWorker?
-Jeff

R K Shyamprakash wrote:

>Jeff,
>	I did use SwingWorker. Say, I am loading an object into my VTK+JAVA
>application. This takes few seconds during which my Java repaint thread is
>blocked(Considering I call VTK objects from the event thread). If I call the
>same objects from a SwingWorker, the repaint problem seems to have reduced.
>the object loads well into vtkCanvas but as soon as I move my mouse over it
>VTK throws following error.
>
>ERROR:vtkWin32OpenGLRenderWindow
>vtkWin32OpenGLRenderWindow:wglMakeCurrent failed.
>
>I have applied locks where ever necessary. I don't get this problem when I
>run the application from the event dispatching thread. Is there any work
>around for this?
>
>Thanks
>Shyam
>
>
>
>-----Original Message-----
>From: vtkusers-admin at public.kitware.com
>[mailto:vtkusers-admin at public.kitware.com]On Behalf Of Jeff Lee
>Sent: Thursday, May 29, 2003 3:58 PM
>To: R K Shyamprakash
>Cc: Vtkusers (E-mail)
>Subject: Re: [vtkusers] VTK and Garbage Collection
>
>
>
>
>R K Shyamprakash wrote:
>
>  
>
>>Hi,
>>       My VTK  application becomes slower after few operations and
>>sometimes it locks the processor. How can I garbage collect VTK objects so
>>that serious memory concerns does not arise.
>>
>>    
>>
>how do you know that the slowdown is related to memory consumption?  vtk
>objects, as all java objects are garbage collected when they are no
>longer referenced by any other object.  do you notice an increase in
>performance after garbage collection runs?
>
>  
>
>>	I am using VTK 4.2 with Java. Also the Java component have repaint problem
>>when an intensive vtk operation is going on. Is there any work around for
>>this.
>>
>>    
>>
>common problem due to the fact that you are likely tying up the event
>thread with your calculation.  there are a variety of solutions to this,
>one being to thread the calculation.  look for the SwingWorker class on
>java website for more details.
>Jeff
>
>  
>
>>Thanks
>>Shyam
>>
>>_______________________________________________
>>This is the private VTK discussion list.
>>Please keep messages on-topic. Check the FAQ at:
>>    
>>
><http://public.kitware.com/cgi-bin/vtkfaq>
>  
>
>>Follow this link to subscribe/unsubscribe:
>>http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>>
>>    
>>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
>
>
>
>  
>

-- 
Jeff Lee
Software Engineer
Computational Dynamics North America Ltd
21 Lafayette Street, Suite 230
Lebanon NH 03766 USA
fax:   603 643 9994
phone: 603 643 9993 x109
http://www.cd-adapco.com





More information about the vtkusers mailing list