Topic: Memory leak coming from vector "iniFonts" in Graph.java
We are using the JHPlot API in our scientific data acquisition software. Basically, the application runs a script that acquire and process data intermittently, then display the last processed data in a display window (built atop HPlot), every 1m30s approximately. For some unknown reason until yesterday, the application was always starting to act up on us after around 23h30 of execution.
We've been having this trouble for quite some time and I just figured out where it was coming from.
I'm running JVisualVM profiler against the running application. It looks like the java heap somehow gets filled up to its limit. But the JVM is smart enough to garbage collect just enough to prevent an outofmemoryexception. Looking at the GC activity, we notice it take a LOT of CPU activity.
When dumping the heap to a file and examine it more thoroughly, we notice it is completely filled with instances of 2 objects:
You heard right: Font objects filling up memory! This does seem like a memory leak, doesn't it?
The variable name that seems to be in cause is iniFonts, vector of java.awt.Font that is found in Jplot's Graph.java.
I'm running out of ideas on how to solve this. My best guess as to what's happening is well described here http://www.fasterj.com/articles/finalizer2.shtml. If you could help me out on this one, it would be greatly appreciated!