Get the latest tech news
JVM statistics cause garbage collection pauses (2015)
TL;DR: The JVM by default exports statistics by mmap-ing a file in /tmp (hsperfdata). On Linux, modifying a memory mapped file can block until disk I/O completes, which can be hundreds of milliseconds.
On Linux, modifying a memory mapped file can block until disk I/O completes, which can be hundreds of milliseconds. Since the JVM modifies these statistics during garbage collection and safepoints, this causes pauses that are hundreds of milliseconds long. The only workaround I've found is to place the mmap-ed file in tmpfs (a RAM disk), or disable it completely.
Or read this on Hacker News