5 Replies Latest reply: Feb 11, 2013 2:20 AM by Kayaman RSS

    How do I flush sun.swing.CachedPainter?

      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...