Skip to content

evanj/mmap-pause

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pauses when writing mmap-ed files

See my blog post for details.

  1. Start a new Ubuntu image.
  2. 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
  1. Copy these files to this machine.
  2. gcc --std=gnu99 -O3 -Wall -Wextra -o mmapwritepause mmapwritepause.c
  3. Start screen. In one terminal: ./mmapwritepause /tmp/mmapout
  4. In another terminal: ./diskload.sh
  5. Watch the output of mmapwritepause; it will print long pauses.

JVM reproduction

  1. javac MakeGarbage.java
  2. java -XX:+PrintGCDetails -XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -Xmx1G -Xms1G MakeGarbage
  3. 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.

About

Writes to mmap-ed files on Linux can cause JVM garbage collection pauses

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published