This discussion is archived
5 Replies Latest reply: Feb 11, 2013 12:20 AM by Kayaman RSS

How do I flush sun.swing.CachedPainter?

ForceRs Newbie
Currently Being Moderated
In my applet, I populate a very large JTextArea. It gets opened in a JTabbedPane. When the user closes the tab, I remove the JTextArea.

BUT... After removing it, I get a huge lingering object in memory called sun.swing.CachedPainter.

Here is pic of lingering object taken in YourKit:
<img src="http://www.printdesktop.com/Oracle/CachedPainter.gif">

After about 10 minutes, the memory gets cleared; forcing garbage collection myself does not clear the memory. Somehow the cache is flushed without programmer intervention. I would like to forcefully flush the cache if possible.

Edited by: ForceRs on Feb 6, 2013 4:18 PM - Trying to get image to show inline...

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points