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 on 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*64*1024K = 4GB objects through the heap.

herong> java -Xms500m -Xmx500m GCPerformance 1024 64 64 0 64

Parameters: Size=1024KB, Base=64, Chunk=64, Wait=0ms, Warmup=64
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.
32:32  500  2000:2000:2000:2000  512000:248588  64
78:78  718  1641:1391:2000:1391  512000:248514  128
...
297:297  718  2154:1391:4266:2064  512000:248503  640
313:313  718  2249:1391:4266:4000  512000:248501  704
344:344  718  2232:1391:4266:2064  512000:248503  768
..

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

herong> java -Xms500m -Xmx500m GCPerformance 1024 64 64 10 64

Parameters: Size=1024KB, Base=64, Chunk=64, Wait=10ms, Warmup=64
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.
36:26  406  2461:2461:2461:2461  512000:248584  64
81:61  547  2098:1828:2461:1828  512000:248508  128
...
474:344  547  2418:1828:2909:2461  512000:248496  832
510:370  547  2421:1828:2909:2461  512000:248494  896
550:400  547  2400:1828:2909:2133  512000:248496  960

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

herong> java -Xms500m -Xmx500m GCPerformance 1024 64 64 100 64

Parameters: Size=1024KB, Base=64, Chunk=64, Wait=100ms, Warmup=64
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.
121:21  328  3047:3047:3047:3047  512000:248584  64
264:64  672  2000:1488:3047:1488  512000:248507  128
...
2152:452  672  2407:1488:4571:4266  512000:248494  1088
2281:481  672  2395:1488:4571:2206  512000:248494  1152
2400:500  672  2432:1488:4571:3368  512000:248494  1216

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

herong> java -Xms500m -Xmx500m GCPerformance 1024 64 64 1000 64

Parameters: Size=1024KB, Base=64, Chunk=64, Wait=1000ms, Warmup=64
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.
1028:28  437  2285:2285:2285:2285  512000:248589  64
2075:75  734  1706:1361:2285:1361  512000:248509  128
...
25656:656  734  2439:1361:4266:3368  512000:248497  1600
26681:681  734  2443:1361:4266:2560  512000:248495  1664
27713:713  734  2423:1361:4266:2000  512000:248493  1728

Test result summary

Wait   Throughput   Latency
----   ----------   -------
1000         2423       734
 100         2432       672
  10         2400       547
   0         2232       718

Takeaways: When waiting time is added to the application, the throughput performance seems to be better, because GC can be performed during those waiting periods.

However, the test results with JDK 8 on an older computer using Size=1024KB, Base=32, Chunk=32 and Warmup=64 parameters, showed that the throughput performance seems to be decreased when longer wait time is added to the application. I had no idea why.

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

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"

 The Z Garbage Collector (ZGC) - "+XX:+UseZGC"

 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 Object Size

 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

 GCPerfP99V2.java - Percentile Performance with Load

 GCPerfP99V2.java - Work Load Level

 GCPerfP99V2.java - Object Number and Size

 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

 References

 Full Version in PDF/EPUB