Why does JMH run different forks?
问题 I am using the JMH benchmarking framework (http://openjdk.java.net/projects/code-tools/jmh/) to run benchmarks on my code. My understanding is that JMH forks the JVM multiple times during benchmarking in order to discard any profiles built up by the just-in-time (JIT) profiling performed by the JVM during execution. I understand why this is useful in some cases such as the below (copied verbatim from http://java-performance.info/jmh/): By default JHM forks a new java process for each trial