Java12 new features - interruptible G1 Mixed GC

G1 is a garbage collector, it is designed for multiprocessor machines with large amounts of memory. Because of its improved performance efficiency, G1 garbage collector will eventually replace CMS garbage collector.

One of the main objectives of the garbage collector is designed to meet the expectations set by the user JVM pauses.

G1 using a high-level analysis engine selects the workload to be handled during the collection, the result of this selection process is a set of regions called GC recovery (collection set (CSet)) of. Once collected determines the GC back to collect and GC recovery, finishing work has already begun this process is without
to stop after stopping, that is G1 collector must complete all active objects in all regions collection set in; but if the collector Choose large collection GC back, this time STW long time will exceed the target pause time.

This situation is more obvious in mixed collections of the time. This feature of a start mechanism, is selected when a relatively large collection set, Java12 GC will return the collection (collection set mixing) split mandatory (mandatory or required) and (End mandatory portion when optional two parts, if there will be time to process the remaining portion optional) mixed collections to be changed without stopping the abortable, to better meet the objectives of the specified pause time.

Wherein the essential processing section includes a section GC G1 garbage collector can not handle incremental back collected (eg: the young generation), but can also include the old year to improve processing efficiency.

When the GC back collecting the required and optional split into portions, the garbage collection process required priority section. Meanwhile, the need to maintain an optional collection section GC back some additional data, which will produce a slight CPU overhead, but less than 1% change, while during the processing return collected in G1 GC recovery, a native memory usage may increase using the above applies only to a recovery section comprising a GC GC optionally recovering hybrid set.

After the completion of the required fractions were pooled recovered in the G1 garbage collector, if there is time, then, began to collect optional part. However, coarse-grained processing, the processing depends on the particle size of the optional part of the remaining time, can only handle a subset of the selectable portion of the zone. After completion of the optional current collecting portion, G1 garbage collector can determine whether to stop collecting The remaining time. After processing if necessary part of the process, lack of time remaining, total spending time close to the expected time, G1 garbage collector can also suspend an optional part of the recovery to achieve the target to meet the expected pause time.

Guess you like

Origin www.cnblogs.com/androidsuperman/p/11742876.html