How to clean/displose a JCanvas and avoid Out-Of-Memory

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to clean/displose a JCanvas and avoid Out-Of-Memory

Andreas
Hi,

I'm still developing a Netbeans Platform application. I'm having a problem with a memory leak if I use a JCanvas3D inside a TopComponent. If I open and close the TopComponent many times (depending on the heapsize) I run into OutOfMemory (to many int[] from the created BufferedImage of the JCanvas3D). Is there something that I forgott to do to completely destroy a JCanvas3D including the BufferedImage an DataMemoryInt stuff.

Andreas
Reply | Threaded
Open this post in threaded view
|

Re: How to clean/displose a JCanvas and avoid Out-Of-Memory

gouessej
Administrator
Maybe use getOffscreenCanvas3D(), try to get the buffered image used internally and flush it. Temporary objects should not put you into a situation in which you run out of memory.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: How to clean/displose a JCanvas and avoid Out-Of-Memory

Andreas
Ok, I found my error. I forgot to call the cleanup of the SimpleUniverse.