Reputation:
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:
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
Upvotes: 4
Views: 351
Reputation: 18458
From the docs on Oracle JVM, the note says
Next, you might try decreasing the amount of heap used. A larger heap will cause garbage collection pauses to increase because there is more heap to scan.
It is also function of GC algorithm you use. For example incremental GC may give completely different numbers. (Try -Xincgc
and see your numbers)
Upvotes: 3