Java 8 GC Tutorials - Herong's Tutorial Examples - v1.03, by Dr. Herong Yang
Adaptive Size Policy Changed Survivor Space
This section provides a tutorial on how Adaptive Size Policy used by the Parallel collector changed the survivor space in the Young generation.
In GC log example presented in the last tutorial, the Adaptive Size Policy of the Parallel collector suggested to keep Young generation size as is.
In this tutorial, we will look at GC log example from the test that suggests to change the survivor space size:
982 1048576000 818726112 229849888 0.421: Application time: 0.0250769 seconds UseAdaptiveSizePolicy actions to meet *** throughput goal *** GC overhead (%) Young generation: 15.71 (attempted to grow) Tenured generation: 0.00 (no change) Tenuring threshold: (attempted to decrease to avoid survivor space overflow) = 7 {Heap before GC invocations=5 (full 0): PSYoungGen total 409600K, used 224450K [... eden space 204800K, 99% used [0x2a000000,0x367f09b0,0x36800000) from space 204800K, 9% used [0x43000000,0x44340170,0x4f800000) to space 204800K, 0% used [0x36800000,0x36800000,0x43000000) ParOldGen total 614400K, used 12K [... 0.422: [GC (Allocation Failure) -- Message generated by -XX:+PrintAdaptiveSizePolicy AdaptiveSizePolicy::update_averages: survived: 19145040 promoted: 4096 overflow: false AdaptiveSizeStart: 0.429 collection: 5 avg_survived_padded_avg: 20858680.000000 avg_promoted_padded_avg: 4379.852539 avg_pretenured_padded_avg: 0.000000 tenuring_thresh: 6 target_size: 20971520 -- Suggested to set tenuring threshold to 6 -- Suggested to set survivor space to 20971520 PSAdaptiveSizePolicy::compute_eden_space_size limits: desired_eden_size: 419430400 old_eden_size: 209715200 eden_limit: 209715200 cur_eden: 209715200 max_eden_size: 209715200 avg_young_live: 18728788 -- Suggested to increase "eden" to 419430400 PSAdaptiveSizePolicy::compute_eden_space_size: costs minor_time: 0.170889 major_cost: 0.000000 mutator_cost: 0.829111 throughput_goal: 0.990000 live_space: 287164244 free_space: 419430400 old_eden_size: 209715200 desired_eden_size: 209715200 -- Suggested to keep "eden" as 209715200 AdaptiveSizePolicy::survivor space sizes: collection: 5 (209715200, 209715200) -> (209715200, 20971520) -- Changed survivor spaces to (209715200, 20971520)! AdaptiveSizeStop: collection: 5 [PSYoungGen: 224450K->18696K(409600K)] 224462K->18712K(1024000K), 0.0261534 secs] Heap after GC invocations=5 (full 0): PSYoungGen total 409600K, used 18696K [... eden space 204800K, 0% used [0x2a000000,0x2a000000,0x36800000) from space 204800K, 9% used [0x36800000,0x37a42150,0x43000000) to space 20480K, 0% used [0x4e400000,0x4e400000,0x4f800000) -- "to" space decreased to from 204800K to 20480K! ParOldGen total 614400K, used 16K [... } 0.448: Total time for which application threads were stopped: 0.0267686 s 983 1048576000 1028365984 20210016
As you can see, the "to" survivor space was decreased from 204800K to 20480K based on the Adaptive Size Policy suggestion. May be it is trying to lower the Minor GC time and increase Major GC time.
Table of Contents
Heap Memory Area and Size Control
JVM Garbage Collection Logging
Introduction of Garbage Collectors
Serial Collector - "+XX:+UseSerialGC"
►Parallel Collector - "+XX:+UseParallelGC"
Parallel Collector GC Log Message Format
"-XX:+PrintGCTaskTimeStamps" - Print GC Threads
"-XX:ParallelGCThreads=n" - # of Threads
Parallel Collector Stops Application for Minor/Major GC
PSYoungGen Collector Using Tenuring Age
Parallel Collector Changing NewRatio and SurvivorRatio
Parallel Collector Adaptive Size Policy
Adaptive Size Policy Log Messages
"-XX:+PrintAdaptiveSizePolicy" - Minor GC Report
►Adaptive Size Policy Changed Survivor Space
Adaptive Size Policy Changed Eden Space
Adaptive Size Policy for Best Latency
Adaptive Size Policy for Best Throughput
Concurrent Mark-Sweep (CMS) Collector - "+XX:+UseConcMarkSweepGC"
Garbage First (G1) Collector - "+XX:+UseG1GC"
Object References and Garbage Collection
Garbage Collection Performance Test Program
Performance Tests on Serial Collector
Performance Tests on Parallel collector
Performance Tests on Concurrent collector
Performance Tests on G1 collector