| Author |
Garbage Collection & Memory Problem.
|
Drew Lane
Ranch Hand
Joined: May 13, 2001
Posts: 296
|
|
I've got a custom java.awt.Canvas that implements Runnable and I'm using it to draw some images on and do some simple animation. Now this Canvas creates a lot of in memory images and I give the user the option to change the color of these images with a menu option. What I've been doing is to remove the canvas from the layout and create a new one with the new colors that the user requests. The problem is that I seem to be running out of memory after changing the colors a few times. How can I be sure that all of the images that got created with the Canvas are destroyed and the memory is reclaimed by the VM? If I just set the reference to the Canvas to null will that return the memory that was being used by the images when the garbage collector comes around? Thanks, Drew
|
 |
 |
|
|
subject: Garbage Collection & Memory Problem.
|
|
|