The GC time is too long in my spark streaming programme. In the GC log, I found that Someone called System.gc() in the programme. I do not call System.gc() in my code. So the caller should be the api I used.
I add -XX:-DisableExplicitGC to JVM and fix this problem. However, I want to know who call the System.gc().
I tried some methods.
- Use
jstack. But the GC is not so frequent, it is difficult to dump the thread that call the method. - I add trigger that add thread dump when invoke method
java.lang.System.gc()in JProfiler. But it doesn't seem to work.
How can I know who call System.gc() in spark streaming program?