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:
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...
No out-of-memory from it. It just looks odd to close all tabs in the our application and still be using over 67 MB of storage -- even after the user clicks the manual GC button I show on the Java Memory Widget. Our customer support gets calls about this, and then I have to look into it. And what I found the cause to be is this lingering storage issue.
As a developer, I am not worried about it. I thought if I could get it cleaned up, I wouldn't have to re-investigate this at a later date. I tried a lot of things to "tickle" the CachedPainter into dropping the 67MB of text its holding onto, but after 12 minutes, it does disappear on its own.