See my blog post for details.
- Start a new Ubuntu image.
- Run the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-virtual gcc screen openjdk-8-jdk
sudo reboot
- Copy these files to this machine.
- gcc --std=gnu99 -O3 -Wall -Wextra -o mmapwritepause mmapwritepause.c
- Start screen. In one terminal: ./mmapwritepause /tmp/mmapout
- In another terminal: ./diskload.sh
- Watch the output of mmapwritepause; it will print long pauses.
- javac MakeGarbage.java
- java -XX:+PrintGCDetails -XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -Xmx1G -Xms1G MakeGarbage
- In another terminal, run ./diskload.sh
This will show large safepoint times, correlated with when mmapwritepause reports pauses. To verify that disabling the stats fixes the problem, add -XX:+PerfDisableSharedMem and rerun it.