Graphics
Hey, I was wondering if someone might be able to spread some light on a problem im having.
I have a custom JComponent that im using to draw custom graphics into, this JComponent is housed within the main part of the gui in a JPanel.
Depending on what the user does the JComponent could be drawing something very light, or something very heavy (basically its drawing a truth table, it could have 2 - 30 propositions inside it). Everything works ok, except that the memory used to draw a very large image is being retained by the JVM, so if for example I draw something very big (and it requires 20mb's of memory to do so) and then continue on to draw something very small the memory used previously isn't deallocated.
Obviously I thought that I had some erroneous references left pointing to the Image object im using for my drawing and it wasn't getting gc'ed after I'd nulled it, but it would appear not as I can successfully get finalize messages, I then tried dispose() 'ing the graphic objects that I use, this also doesn't have any effect. And now im stuck.
Can anyone help ?
I have a custom JComponent that im using to draw custom graphics into, this JComponent is housed within the main part of the gui in a JPanel.
Depending on what the user does the JComponent could be drawing something very light, or something very heavy (basically its drawing a truth table, it could have 2 - 30 propositions inside it). Everything works ok, except that the memory used to draw a very large image is being retained by the JVM, so if for example I draw something very big (and it requires 20mb's of memory to do so) and then continue on to draw something very small the memory used previously isn't deallocated.
Obviously I thought that I had some erroneous references left pointing to the Image object im using for my drawing and it wasn't getting gc'ed after I'd nulled it, but it would appear not as I can successfully get finalize messages, I then tried dispose() 'ing the graphic objects that I use, this also doesn't have any effect. And now im stuck.
Can anyone help ?
