I am benchmarking a JVM application which puts very heavy load on both disk IO and CPU.
Normally I benchmark it using 4G max/min heap size, the whole benchmark suit takes in average 73 seconds to run.
Today I was curious and gave it only 1G max/min heap size, and surprisingly the whole benchmark suit takes only 62 seconds to run in average.
So I wonder why does JVM perform better with a smaller heap size?
Extra notes:
- The above benchmark results are reliably reproducible on this machine.
- Benchmark source code https://github.com/HouzuoGuo/Aurinko2/blob/master/src/test/scala/net/houzuo/aurinko2/test/logic/Benchmark.scala
Environment:
java version "1.7.0_19"
OpenJDK Runtime Environment (fedora-2.3.9.1.fc17-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
Linux ____ 3.8.4-102.fc17.x86_64 #1 SMP Sun Mar 24 13:09:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux