Performance Impact of Chunk Size

This section provides tests to find out performance impact of the chunk size (number of objects created and released in a single test run). The throughput performance seems to be not impacted by the chunk size, if some throughput jumps are ignored.

While running tests with GCPerformance.java, I also noticed an interesting behavior when using a lower test chunk size.

Test 1: Running GCPerformance.java with chunk size of 16 objects. For some test runs, the throughput jumped from 516 to 1000 objects:

C:\>\progra~1\java\jdk1.8.0\bin\java
   -Xms1600m -Xmx1600m GCPerformance 1024 32 16 0 64

Parameters: Size=1024KB, Base=32, Chunk=16, Wait=0ms, Warmup=64
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.

16:16  1000  1000:1000:1000:1000  1583808:1304597  16
                            ----
   Throughput jumped on here - |

47:47  1937  680:516:1000:516  1583808:1288213  32
78:78  1937  615:516:1000:516  1583808:1271829  48
110:110  2000  581:500:1000:500  1583808:1255444  64
141:141  2000  567:500:1000:516  1583808:1239060  80
172:172  2000  558:500:1000:516  1583808:1222676  96
...
1264:1264  2941  506:340:1000:340  1583808:1534408  640
1280:1280  2941  512:340:1000:1000  1583808:1517530  656
                              ----
     Throughput jumped on here - |

1311:1311  2941  512:340:1000:516  1583808:1501146  672
1342:1342  2941  512:340:1000:516  1583808:1484762  688
1373:1373  2941  512:340:1000:516  1583808:1468378  704
...
2824:2824  2941  509:340:1000:516  1583808:1157062  1440
2840:2840  2941  512:340:1000:1000  1583808:1140678  1456
                              ----
     Throughput jumped on here - |

2871:2871  2941  512:340:1000:516  1583808:1124293  1472
2902:2902  2941  512:340:1000:516  1583808:1107909  1488
...

Test 2: Running GCPerformance.java with chunk size of 24 objects. For some test runs, the throughput jumped from 510 to 774 objects:

C:\>\progra~1\java\jdk1.8.0\bin\java
   -Xms1600m -Xmx1600m GCPerformance 1024 32 24 0 64

Parameters: Size=1024KB, Base=32, Chunk=24, Wait=0ms, War
Real:Exec  Lat.     Throughput      Total:Free  Proc.
Time:Time  ms/o  Ave:Min:Max:Chunk   Mem.:Mem.   Obj.
...
2792:2792  2631  507:380:521:387  1583808:1525691  1416
2839:2839  2631  507:380:521:510  1583808:1501115  1440
2886:2886  2631  507:380:521:510  1583808:1476539  1464
2917:2917  2631  510:380:774:774  1583808:1451962  1488
                            ----
   Throughput jumped on here - |

2964:2964  2631  510:380:774:510  1583808:1427386  1512
3010:3010  2631  510:380:774:521  1583808:1402809  1536
...
4227:4227  2631  511:380:774:510  1583808:1206194  2160
4258:4258  2631  512:380:774:774  1583808:1181618  2184
                            ----
   Throughput jumped on here - |

4305:4305  2631  512:380:774:510  1583808:1157042  2208
4352:4352  2631  512:380:774:510  1583808:1132465  2232
...
5023:5023  2631  511:380:774:510  1583808:1230768  2568
5054:5054  2631  512:380:774:774  1583808:1206192  2592
                            ----
   Throughput jumped on here - |

5101:5101  2631  512:380:774:510  1583808:1181616  2616
5148:5148  2631  512:380:774:510  1583808:1157039  2640
...

Test 3: Running GCPerformance.java with chunk size of 32 objects. For some test runs, the throughput jumped from 516 to 695 objects:

C:\>\progra~1\java\jdk1.8.0\bin\java
   -Xms1600m -Xmx1600m 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.
63:63  1972  507:507:507:507  1583808:1091541  32
141:141  2439  453:410:507:410  1583808:1507275  64
187:187  2439  513:410:695:695  1583808:1474507  96
                          ----
 Throughput jumped on here - |

250:250  2439  512:410:695:507  1583808:1441738  128
312:312  2439  512:410:695:516  1583808:1408970  160

375:375  2439  512:410:695:507  1583808:1376201  192
437:437  2439  512:410:695:516  1583808:1343433  224
499:499  2439  513:410:695:516  1583808:1310664  256
562:562  2439  512:410:695:507  1583808:1277896  288
624:624  2439  512:410:695:516  1583808:1245127  320
687:687  2439  512:410:695:507  1583808:1212359  352
733:733  2439  523:410:695:695  1583808:1179590  384
                          ----
 Throughput jumped on here - |

811:811  2439  512:410:695:410  1583808:1146822  416
874:874  2439  512:410:695:507  1583808:1114053  448
...
2496:2496  2439  512:410:695:516  1583808:1114037  1280
2559:2559  2439  512:410:695:507  1583808:1081268  1312
2637:2637  2439  509:410:695:410  1583808:1499063  1344
2683:2683  2439  512:410:695:695  1583808:1466295  1376
                            ----
   Throughput jumped on here - |

2746:2746  2439  512:410:695:507  1583808:1433526  1408
2808:2808  2439  512:410:695:516  1583808:1400758  1440
...
5616:5616  2439  512:410:695:516  1583808:1230766  2880
5679:5679  2439  512:410:695:507  1583808:1197997  2912
5725:5725  2439  514:410:695:695  1583808:1165229  2944
                            ----
   Throughput jumped on here - |

5788:5788  2439  514:410:695:507  1583808:1132460  2976
5850:5850  2439  514:410:695:516  1583808:1099692  3008
...

Test result summary

Chunk Size    Ave Throughput   Max Throughput
    16 obj               516             1000
    24 obj               510              774 
    32 obj               516              695

If we ignore these jumps, the throughput performance seems to be not impacted by the chunk size.

Why the throughput performance jumped for some test runs? And why the throughput jumps more for chunk size of 16 objects? See next tutorials for answers.

Last update: 2018.

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

 Outdated Tutorials

 References

 Full Version in PDF/EPUB