Benchmark Affected by Other Running Applications

This section provides a tutorial example showing how the benchmark test result is affected by other running applications on the operating system.

In order to confirm where those interruptions are coming from, I repeated the test while I was using Firefox to download a large file from Internet.

C:\herong\jvm>java -XX:+PrintGC -Xms100m -Xmx100m BenchmarkRunner
BenchmarkLoopTest emptyLoop 10000 3 3

Are you ready?
y

Waking up the JIT compiler...
Run: 1, Time: 6146, Test returns: 3
Run: 2, Time: 3632, Test returns: 3
Run: 3, Time: 3352, Test returns: 3
...
Run: 447, Time: 2235, Test returns: 3
Run: 448, Time: 12571, Test returns: 3
Run: 449, Time: 3631, Test returns: 3
...
Run: 713, Time: 2235, Test returns: 3
Run: 714, Time: 104482, Test returns: 3
Run: 715, Time: 2514, Test returns: 3
...
Run: 890, Time: 2515, Test returns: 3
Run: 891, Time: 11733, Test returns: 3
Run: 892, Time: 6146, Test returns: 3
...
Run: 2608, Time: 1956, Test returns: 3
Run: 2609, Time: 10336, Test returns: 3
Run: 2610, Time: 1955, Test returns: 3
...
Run: 3304, Time: 1955, Test returns: 3
Run: 3305, Time: 10058, Test returns: 3
Run: 3306, Time: 1955, Test returns: 3
...
Run: 5818, Time: 1955, Test returns: 3
Run: 5819, Time: 10336, Test returns: 3
Run: 5820, Time: 1955, Test returns: 3
...
Run: 5980, Time: 1955, Test returns: 3
Run: 5981, Time: 3073, Test returns: 3
Run: 5982, Time: 20393, Test returns: 3
Run: 5983, Time: 2514, Test returns: 3
Run: 5984, Time: 1955, Test returns: 3
...
... 10 more interruptions
...

Conclusions based on the test result:

Last update: 2010.

Table of Contents

 About This Book

 Downloading and Installing JDK 1.8.0 on Windows

 Downloading and Installing JDK 1.7.0 on Windows

 java.lang.Runtime Class - The JVM Instance

 java.lang.System Class - The Operating System

 ClassLoader Class - Class Loaders

 Class Class - Class Reflections

 Sun's JVM - Java HotSpot VM

 JRockit JVM 28.2.7 by Oracle Corporation

 JVM Runtime Data Areas

 Memory Management and Garbage Collectors

 Garbage Collection Tests

 JVM Stack, Frame and Stack Overflow

 Thread Testing Program and Result

 CPU Impact of Multi-Thread Applications

 I/O Impact of Multi-Thread Applications

 CDS (Class Data Sharing)

Micro Benchmark Runner and JVM Options

 What Is Micro Benchmark?

 BenchmarkRunner.java - Benchmark Runner Program

 emptyLoop() - The Empty Loop Test Method

 "-XX:+PrintCompilation" - Watching JIT Compilation Logs

 "-XX:+PrintGC" - Watching GC (Garbage Collection) Logs

 "-Xms" and "-Xmx" - Avoiding GC with Large Memory Size

Benchmark Affected by Other Running Applications

 "-Xint" - Running in Interpreted-Only Mode

 Micro Benchmark Tests on "int" Operations

 Micro Benchmark Tests on "long" Operations

 Micro Benchmark Tests in JIT Compilation Mode

 Micro Benchmark Tests on "float" and "double" Operations

 Outdated Tutorials

 References

 PDF Printing Version