We have a java application which need almost Realtime response. But we are also seeing pauses up to 8sec.
Special running condition:
- In some intervals the application would serialize a huge data snapshot of size up to 1.5G in to the disk (SSD).
- Occasionally some heavy background I/O happens by some other coexisting process in the m/c.
What we are ovserving, DURING the interval when this large serialization write happens, if by chance the GC kicks in, it is causing a huge 6 to 8 sec pause, the JVM is in completely unresponsive/frozen state.
From the JFR recording it shows that,
- ALL the threads are is in parked/wait/sleep states, except the one which is writing to the disk.
- The G1 GC takes about 200ms to finish GC.
From the GC Log: 2018-09-05T18:23:40.277+0000: 39892.345: Total time for which application threads were stopped: 8.3785112 seconds, Stopping threads took: 8.3765855 seconds
Java Version: java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b25) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b25, mixed mode)
Questions:
- Why such 8sec non-GC JVM pause, when GC and background I/O happens at the same time?
- How to overcome this large pause?
JFR file: https://www.filehosting.org/file/details/756217/Run.jfr