Performance Impact of Wait Time

This section provides tests to find out performance impact of the wait time between each chunk operations. Increasing wait time seems to decrease throughput performance.

The wait time introduced in the test loop can be used to slowdown the tests so we can have an easier time watching the test print output on the screen.

But wait time may also have an impact the GC performance. Let's find it with some tests.

Test 1: Running GCPerformance.java without wait time with the Serial Collector. 64 iterations of warmup is specified to flush 64*32*1024K = 2GB objects through the heap.

herong> \progra~1\java\jdk1.8.0\bin\java \
   -Xms100m -Xmx100m GCPerformance 1024 32 32 0 64

Parameters: Size=1024KB, Base=32, Chunk=32, Wait=0ms, Warmup=64
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.
0:0  2469  405:405:405:405  99008:32689  32
0:0  2785  380:359:405:359  99008:32689  64
...
14:14  3787  400:264:438:367  99008:32689  5696
14:14  3787  400:264:438:363  99008:32689  5728
...

Test 2: Same as Test 1, but with 10ms wait time added:

herong> \progra~1\java\jdk1.8.0\bin\java \
   -Xms100m -Xmx100m GCPerformance 1024 32 32 10 64

Parameters: Size=1024KB, Base=32, Chunk=32, Wait=10ms, Warmup=64
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.
0:0  2469  405:405:405:405  99008:32689  32
0:0  2469  405:405:405:405  99008:32689  64
...
15:14  4329  399:231:438:410  99008:32689  5600
15:14  4329  399:231:438:405  99008:32689  5632
...

Test 3: Same as Test 2, but with 100ms wait time added:

herong> \progra~1\java\jdk1.8.0\bin\java \
   -Xms100m -Xmx100m GCPerformance 1024 32 32 100 64

Parameters: Size=1024KB, Base=32, Chunk=32, Wait=100ms, Warmup=64
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.
0:0  2724  367:367:367:367  99008:32689  32
0:0  3344  329:299:367:299  99008:32689  64
...
26:13  5128  291:195:410:340  99008:32689  4064
26:14  5128  291:195:410:310  99008:32689  4096
...

Test 4: Same as Test 3, but with 1000ms wait time added:

herong> \progra~1\java\jdk1.8.0\bin\java  \
   -Xms100m -Xmx100m GCPerformance 1024 32 32 1000 64

Parameters: Size=1024KB, Base=32, Chunk=32, Wait=1000ms, Warmup=64
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.
1:0  2500  400:400:400:400  99008:32689  32
2:0  3508  333:285:400:285  99008:32689  64
...
82:8  4975  290:201:400:296  99008:32698  2368
83:8  4975  290:201:400:280  99008:32698  2400
...

Test result summary

Wait   Throughput   Latency
----   ----------   -------
1000          290      4975
 100          291      5128
  10          399      4329
   0          400      3787

Takeaways: The throughput performance seems to be decreased when more longer wait time is added to the application. I am not sure why.

Table of Contents

 About This Book

 Heap Memory Area and Size Control

 JVM Garbage Collection Logging

 Introduction of Garbage Collectors

 Serial Collector - "+XX:+UseSerialGC"

 Parallel Collector - "+XX:+UseParallelGC"

 Concurrent Mark-Sweep (CMS) Collector - "+XX:+UseConcMarkSweepGC"

 Garbage First (G1) Collector - "+XX:+UseG1GC"

 Object References and Garbage Collection

Garbage Collection Performance Test Program

 GCPerformance.java - GC Performance Test Program

 GCPerformance.java - Program Output

Performance Impact of Wait Time

 Performance Impact of Chunk Size

 Performance Jumps Not Related to GC

 Performance Test and System Interruptions

 "START /REALTIME" - Run JVM with Highest Priority

 GCPerfP99.java - 99th Percentile Performance

 GCPerfP99.java - Output Verification

 Performance Tests on Serial Collector

 Performance Tests on Parallel collector

 Performance Tests on Concurrent collector

 Performance Tests on G1 collector

 Garbage Collection Performance Test Summary

 Archived Tutorials

 References

 Full Version in PDF/EPUB