I suspect a slow memory leak caused by JNI code. I'm seeing the GC Roots # in the summary of consecutive heap dumps climbing. After two hours it showed 470,000 GC roots, after six hours, almost a million more GC roots, after 33 hours over 7 million GC roots.
However, when I look at the Head Dump that says there are 7 million GC roots, and I choose the "Objects" view and the "GC Roots" preset, I select Aggregation "Types". This list shows a total count of less than 15,000 objects:
- JNI global - count 7857
- JNI local - count 5
- Java frame - count 983
- monitor used - count 7
- sticky class - count 3596
- thread object - count 145
Where are those 7 million roots?
Different GC roots can reffer to the same object instance. This explains the difference, since count from "GC root" view display number of unique instances. You can find more details using OQL. First let's display number of GC roots for particular GC type:
Running this query against your heap dump produces:
We can see that the majority of GC roots are of "JNI local" type. Let us see how many "JNI local" roots point to the same object instance. We can modify above query to:
The result is below:
We can see that two strings
java.lang.String#44429andjava.lang.String#55081are responsible for that huge number of GC roots. They have 6,5 million GC roots each.Those "JNI local" GC root are referenced from
MessageDispatherThread-1 (tid=216)from frameca.digitalrapids.kayak.jni.KayakNativeWorkerThread.runNative (Native Method). See screenshots below: