hsperfdata causing long GC/safepoint times: Don't use mmap?

Srinivas Ramakrishna ysr1729 at gmail.com
Thu Mar 26 22:39:19 UTC 2015


It's a non-issue with a pure ram-based file system. Or tmpfs with no swap. The issue arises only when the backing file is disk based or the ram-based backing file is subject to swapping.

The workaround is to ensure that the backing file is not (ever) backed by disk, when pressure on the page cache can cause the file pages to be evicted.

-- Ramki

ysr1729

> On Mar 26, 2015, at 10:54, Dmitry Samersoff <dmitry.samersoff at oracle.com> wrote:
> 
> Evan,
> 
> What filesystem do you use for /tmp ?
> 
> Did you try to reproduce the problem with tmpfs?
> 
> -Dmitry
> 
>> On 2015-03-26 18:14, Evan Jones wrote:
>> At Twitter, I recently discovered that the hsperfdata file that is created
>> by default by the JVM causes long safepoint and GC pauses. It turns out
>> that writes to mmap-ed files can block until disk I/O completes, even if
>> the I/O is to another disk. For details see:
>> http://www.evanjones.ca/jvm-mmap-pause.html
>> 
>> We have been experimenting with adding the -XX:+PerfDisableSharedMem JVM
>> flag on a number of our latency sensitive services, and have seen a
>> significant improvement. Our JVM team (which I am *not* part of), is
>> investigating potential changes to the JVM to prevent this.
>> 
>> Any suggestions for an approach to solving this problem that could be
>> accepted into Hotspot itself? Some options:
>> 
>> * Make the location of this file configurable (this was set with
>> java.io.tmpdir for a time, but then was reverted; see
>> http://bugs.java.com/view_bug.do?bug_id=6447182)
>> 
>> * Use shared memory that is not backed by a file?
>> 
>> * Something else I'm not considering?
>> 
>> 
>> Thanks!
>> 
>> Evan Jones
> 
> 
> -- 
> Dmitry Samersoff
> Oracle Java development team, Saint Petersburg, Russia
> * I would love to change the world, but they won't give me the sources.


More information about the hotspot-runtime-dev mailing list