"In-depth understanding of java virtual machine -JVM advanced features and best practices" study notes p69-100 garbage collector and memory allocation strategy

 

Zhou Zhiming "in-depth understanding of java virtual machine -JVM advanced features and best practices" study notes p69-100 garbage collector and memory allocation strategy

1. garbage collection algorithms:

1.1 mark - sweep algorithm Mark-Sweep

First need to clear labeling objects need to be recovered, the recovery of all unified object is marked in the mark after completion.

Two process efficiency is not high. It will produce a large amount of memory fragmentation after discontinuous mark cleared.

 

1.2 replication algorithm

Available memory capacity is divided by two equal in size, uses only one of them. Each time the memory is recovered to the entire half region. Memory allocation when they do not consider the complexities of memory chips and so on. As long as the top of the stack pointer movement, can be assigned in order to achieve a simple, efficient operation.

But the cost of this algorithm is to reduce memory by half.

95% of the new generation of objects Chaosheng Xi die Hotspot virtual machine default size and proportion of Eden Survivor is 8: 1.

When Survivor space is not enough, need to rely on other memory (referred to herein as the old year) allocated guarantee (Hanle Promotion).

 

1.3 mark - Collation Algorithm

Replication algorithm will be carried out more replication objects at higher survival rate, efficiency will be low.

Old's unusual use of this algorithm.

Next steps are not directly recycled objects to clean up, but to all surviving objects are moved to the end, then clean out the direct memory other than the end border

 

1.4 generational collection algorithm

Garbage collection algorithms contemporary business virtual machine implements a "generational collection" algorithm. Depending on whom the survival period of the memory is divided into a few pieces, usually the java heap into the new generation and the old era.

The new generation, each time garbage collection when there are a large number of objects found dead, only a few survive, then copy the selection algorithm;

Old era because of the high survival rate of the object, there is no additional space allocated to him guarantee, you must use the "mark - clean-up" or "mark - finishing" algorithm for recycling.

 

 

2.HotSpot algorithm

2.1 Enumeration root

GC pause stop the world

oopMap

2.2 Safety point Safe Point

 

Preemptive interrupts: threaded code does not need to take the initiative to cooperate, when GC occurs, first of all threads in all the disruption, if found to have local interrupted thread safety is not the point, on the resumption of the thread, so she ran to the safety point. Now almost no virtual machine implementation uses preemptive thread is interrupted in response to pause GC events.

Active Break: When GC needs to be interrupted thread does not directly operate ui thread, just a simple set a flag. Each thread initiative to mark the implementation of this poll, found that the interrupt flag is really on their own interrupt is pending. Polling places and safety signs point coincide.

 

2.3 safe area safe Region

Among piece of code fragments, a reference relationship will not change. It began GC are safe in this area anywhere in the forehead.

When the thread execution to Safe Region code, first identify that they have entered Safe Region, as at this time when the JVM to initiate gc, do not control the state identified itself as the Safe Region thread, and the thread to leave Safe Region when he wanted to check whether the system has completed the enumeration root node, or the entire GC process, if completed, that thread continues, otherwise he would have to wait until you receive can be safely leaves the safe Region of the signal.

 

3. The garbage collector

3.1 Serial single-threaded Collector Collector

Only use a cell phone or a cpu thread to complete garbage collection;

When garbage collection is performed, the amount of work necessary to suspend all other thread until the end of his collection. This work is actually Z automatically initiate and automatically in the background by the virtual machine, thread invisible to the user at the situation right amount of all the user's normal work stopped.

Virtual machine running in client mode, the default amount of the new generation of collectors /

 

3.2 ParNew collector

Multi-threaded version of the Serial collector.

In addition to Serial, ParNew can only be used with the CMS collector

 

3.3 Parallel Scavenge collector

The new generation of collectors, the algorithm: algorithm for parallel multi-threaded copying collector.

Different concerns:

CMS and other collectors focus: to shorten the pause time garbage collector thread of the user as possible.

Parallel Scavenge collector concern: to achieve a throughput can be controlled.

Throughput: ratio of the total CPU time consumed and the time for the CPU to run the code.

 

The shorter the time the more suitable pause the program needs to interact with the user, a good response rate can improve the user experience.

High throughput can be efficient use of CPU time computing tasks to complete the program as soon as possible, mainly for operations in the background without too much interaction tasks.

 

Throughput control parameters:

-XX: MaxGCPauseMills: maximum control garbage collection pause times. GC pause time is reduced at the expense of throughput and space for the new generation.

-XX: GCTimeRatio: Throughput size directly. The ratio of the total garbage collection time period, corresponding to the inverse of throughput.

 

Thus, Parallel Scavenge also often referred to as "a certain priority" collector.

GC adaptive adjustment strategy:

Parallel Scavenge collector has a parameter -XX: UseAdaptiveSivePolicy, a switch parameter, after opening, there is no need to manually specify the size of the new generation (-Xmn), Eden and Survivor ratio (-XX: SurvivorRatio), object size promotion year old (-XX: PretenureSizeThreshold) and other details of the parameters. Virtual machine performance monitoring information collected in accordance with the operation of the current system, dynamically adjust these parameters to provide the most appropriate time to pause or maximum throughput.

"In-depth understanding of java virtual machine JVM advanced features and best practices" p80

 

3.4 Serial Old collectors

Serial Old old's version of the Serial collector, the collector is a single-threaded. Use the "mark - finishing" algorithm.

Meaning is: to the virtual machine in the Client mode to use.

In Server uses two modes: 1. In jdk1.5 and earlier in the Parallel Scavenge collector with the use of

2. CMS collector as a backup plan, use in Concurrent Mode Failure concurrent collection happen.

 

3.4 Parallel Old collectors

Parallel Old is old Parallel Scavenge collector's edition. The use of multi-threading and "mark - finishing" algorithm

jdk1.6 later began to use.

Prior to this, the old and the new generation of Parallel Scavenge's Serial Old configured to use no choice but (as Parallel Scavenge not work with CMS), because the old year Serial Old dragged on server performance, single-threaded years old phone We can not take full advantage of multi-CPU server processing power, throughput even as ParNew + CMS combined "to force."

 

After Parallel Old collectors appeared, "throughput priority" collector finally have a true comparison application portfolio, focusing on throughput and CPU resources in sensitive applications, you can prioritize Parallel Scavenge + Parallel Old collector.

 

3.4 CMS collector

(Concurrent Mark Sweep) is a collector for recovering the shortest pause time target collector.

Suitable rate-oriented service response, the application server needs desired pause time is the shortest or Internet site B / S system.

 

step:

Initial - Mark what objects can be linked directly to the GC Roots, very fast.

Concurrent mark - GC Roots Tracing, users can work simultaneously with thread.

Re-marking - marking period correction concurrent user program due to the continued operation which led to marked record that part of the object from label changes. Time but shorter than the original mark length than concurrent mark.

Concurrent clear - users can work simultaneously with the thread.

 

The whole process takes the longest concurrent mark and clear process of collecting concurrent threads can work with user threads, so generally speaking, memory recovery process CMS collector starts concurrent execution of user threads together.

 

Somewhat mainly been reflected in the name: the collection of concurrent low pause. Some documents also known as concurrent low pause collector (Concurrent Low Pause Collector).

There are three drawbacks:

1.CMS collectors are very sensitive to CPU resources, since taking up part of the thread.

2.CMS floating garbage collector can not handle, appear willing to spoof "Concurrent Mode Failure" caused by the failure to produce another of Full GC.

3.CMS is based on a "clear markers" algorithm collector, collecting end have a lot of space debris. Years old and the remaining space is large, but can not find a large enough contiguous space to allocate the current object, we have been forced to trigger a Full GC.

-XX: + UseCMSCompactAtFullCollection switch parameters: default open. When the finishing process for the merger to continue to stand in the open rather Full GC CMS collector memory fragmentation, memory consolidation process is not complicated by the problem of space debris is gone, but not the same long pauses.

-XX: After CMSFullGCsBeforeCompaction, set the execution for how many times the uncompressed Full GC, followed by a band compression (default value is 0, which means every time you have to defragment enter Full GC)

 

3.5 G1 collector

Garbage-First G1 collector,

Features: parallel and concurrent, generational collection, spatial integration (as a whole "mark - finishing," local "copy", predictable pause)

Ning continue avoid heap of garbage collection across the region throughout java, G1 tracking (space recovery experience acquired and the time required for recovery) each Region of garbage piled up inside the value of size, in the background to maintain a priority list, every according to sub-collection time allowed, the maximum value of the Region priority recovery. This use of memory space and Region division have priority area recovery methods to ensure the G1 collectors can obtain the highest possible collection efficiency in a limited time.

step:

Initial - Mark what objects can be linked directly to the GC Roots, and modify the value of TAMS (Next Top at Mark Start), so that the next phase of the user program to run concurrently, can create new objects in the correct available Region, this stage We need to stop thread. But it takes very short. ,

Concurrent mark - starting with GC Roots of heap objects reachability analysis, find the object survival, time-consuming, but the user can perform concurrent threads.

The final mark - To fix during concurrent mark because the user program continues to operate two marks lead to that part of the record mark fluctuates - "Remeber Set Logs -" Rememberd Set. Need to stop thread, but can be executed in parallel.

Filter Recycling - First continue Ning sort of recovery value and the cost of each Region and to specify the recycling program based on user-desired GC pauses.

 

3.6 memory allocation and recovery strategies

Automatic memory management: memory allocated to the object, reclaim the memory allocated to the object.

Memory allocation object, that is allocated on the heap, allocated mainly targeted at the new generation of the Eden area, if i started a thread-local allocation buffer will be allocated on a priority TLAB thread. A few cases may be directly allocated in the old era, the rules of distribution are not one hundred percent fixed. The details depend on the current use of which is to set the garbage collector combination, as well as virtual machines in memory-related parameters.

3.6.1 Objects priority allocation in Eden.

package GCTest; /** * -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 * @author lxp * @version 1.0 * @date 2020/1/30 12:44 */ public class GcTestOne { private static final int _1MB = 1024 * 1024; public static void main(String[] args) { testAllocation(); } public static void testAllocation() { byte[] allocation1, allocation2, allocation3, allocation4; allocation1 = new byte[2 * _1MB]; allocation2 = new byte[2 * _1MB]; allocation3 = new byte[2 * _1MB]; allocation4 = new byte[4 * _1MB]; } }

operation result

"D:\Program Files\java\jdk1.8\bin\java.exe" -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 "-javaagent:D:\codeSoftWare\idea\IntelliJ IDEA 2019.2.1\lib\idea_rt.jar=58567:D:\codeSoftWare\idea\IntelliJ IDEA 2019.2.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\java\jdk1.8\jre\lib\charsets.jar;D:\Program Files\java\jdk1.8\jre\lib\deploy.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\access-bridge-64.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\cldrdata.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\dnsns.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\jaccess.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\jfxrt.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\localedata.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\nashorn.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunec.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunjce_provider.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunmscapi.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunpkcs11.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\zipfs.jar;D:\Program Files\java\jdk1.8\jre\lib\javaws.jar;D:\Program Files\java\jdk1.8\jre\lib\jce.jar;D:\Program Files\java\jdk1.8\jre\lib\jfr.jar;D:\Program Files\java\jdk1.8\jre\lib\jfxswt.jar;D:\Program Files\java\jdk1.8\jre\lib\jsse.jar;D:\Program Files\java\jdk1.8\jre\lib\management-agent.jar;D:\Program Files\java\jdk1.8\jre\lib\plugin.jar;D:\Program Files\java\jdk1.8\jre\lib\resources.jar;D:\Program Files\java\jdk1.8\jre\lib\rt.jar;E:\coding\Practice\out\production\Practice;E:\coding\Practice\lib\asm-5.0.3.jar;E:\coding\Practice\lib\cglib-2.2.jar;E:\coding\Practice\lib\asm-all-7.0.1.jar;E:\coding\Practice\lib\asm-tree-5.0.3.jar;E:\coding\Practice\lib\cglib-nodep-3.2.4.jar;E:\coding\Practice\lib\asm-analysis-5.0.3.jar" GCTest.GcTestOne [GC (Allocation Failure) [PSYoungGen: 6248K->776K(9216K)] 6248K->4880K(19456K), 0.0030607 secs] [Times: user=0.02 sys=0.02, real=0.00 secs] Heap PSYoungGen total 9216K, used 7157K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000) eden space 8192K, 77% used [0x00000000ff600000,0x00000000ffc3b5f8,0x00000000ffe00000) from space 1024K, 75% used [0x00000000ffe00000,0x00000000ffec2020,0x00000000fff00000) to space 1024K, 0% used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000) ParOldGen total 10240K, used 4104K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000) object space 10240K, 40% used [0x00000000fec00000,0x00000000ff002020,0x00000000ff600000) Metaspace used 3448K, capacity 4496K, committed 4864K, reserved 1056768K class space used 376K, capacity 388K, committed 512K, reserved 1048576K Process finished with exit code 0

6248 becomes the new generation of 776kb. Total memory has not changed 9216kb, because three objects are alive, the virtual machine is not recyclable objects found.

The reason GC happens is to receive 4 to allocate memory and found Eden has been occupied 6MB, not enough remaining space has been allocated 4 4MB of memory required, therefore MinorGC occur during GC virtual machine has already found three 3MB all objects not fit Survivor space, (Survivor space is only about 1MB), so transferred by assignment guarantee mechanism to advance to the old year go.

(GC logs is inconsistent with the original book, is due to inconsistencies JDK version, it should be like this. Ah)

 

3.6.2 large objects directly into the old era. (Large objects: java objects requires a lot of contiguous memory space, the most typical of large objects is the kind of long strings and arrays, large object memory allocation for virtual machines is a bad news ,, worse is the case of to a group of "students toward evening off" of large objects, big objects often easily lead to early triggering garbage collection when there are a lot of memory space to get enough space, "placement" they are).

Virtual machines provide a -XX: PretenureSizeThreshold parameters, so that the object is larger than the set value allocated directly in the old era. The aim is to avoid a lot of content replication between the Eden area and two Survivor areas. (Using the new generation of replication algorithm collecting memory)

 

package GCTest; /** * * -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:PretenureSizeThreshold=3145728 * @author lxp * @version 1.0 * @date 2020/1/30 14:03 */ public class BigObject { private static final int _1MB = 1024 * 1024; public static void main(String[] args) { testPretenureSize(); } private static void testPretenureSize() { byte[] allocation; allocation = new byte[4 * _1MB]; } }

 

"D:\Program Files\java\jdk1.8\bin\java.exe" -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:PretenureSizeThreshold=3145728 "-javaagent:D:\codeSoftWare\idea\IntelliJ IDEA 2019.2.1\lib\idea_rt.jar=58221:D:\codeSoftWare\idea\IntelliJ IDEA 2019.2.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\java\jdk1.8\jre\lib\charsets.jar;D:\Program Files\java\jdk1.8\jre\lib\deploy.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\access-bridge-64.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\cldrdata.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\dnsns.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\jaccess.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\jfxrt.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\localedata.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\nashorn.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunec.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunjce_provider.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunmscapi.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunpkcs11.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\zipfs.jar;D:\Program Files\java\jdk1.8\jre\lib\javaws.jar;D:\Program Files\java\jdk1.8\jre\lib\jce.jar;D:\Program Files\java\jdk1.8\jre\lib\jfr.jar;D:\Program Files\java\jdk1.8\jre\lib\jfxswt.jar;D:\Program Files\java\jdk1.8\jre\lib\jsse.jar;D:\Program Files\java\jdk1.8\jre\lib\management-agent.jar;D:\Program Files\java\jdk1.8\jre\lib\plugin.jar;D:\Program Files\java\jdk1.8\jre\lib\resources.jar;D:\Program Files\java\jdk1.8\jre\lib\rt.jar;E:\coding\Practice\out\production\Practice;E:\coding\Practice\lib\asm-5.0.3.jar;E:\coding\Practice\lib\cglib-2.2.jar;E:\coding\Practice\lib\asm-all-7.0.1.jar;E:\coding\Practice\lib\asm-tree-5.0.3.jar;E:\coding\Practice\lib\cglib-nodep-3.2.4.jar;E:\coding\Practice\lib\asm-analysis-5.0.3.jar" GCTest.BigObject Heap PSYoungGen total 9216K, used 6412K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000) eden space 8192K, 78% used [0x00000000ff600000,0x00000000ffc43128,0x00000000ffe00000) from space 1024K, 0% used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000) to space 1024K, 0% used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000) ParOldGen total 10240K, used 0K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000) object space 10240K, 0% used [0x00000000fec00000,0x00000000fec00000,0x00000000ff600000) Metaspace used 3448K, capacity 4496K, committed 4864K, reserved 1056768K class space used 376K, capacity 388K, committed 512K, reserved 1048576K Process finished with exit code 0

 

The execution and results "in-depth understanding of java virtual machine" different original book, because this parameter is only for Serial and ParNew two collectors. Parallel Scavenge do not know the parameters.

By executing java -XX in cmd: + PrintCommandLineFlags -version,

 

 

 

3.6.3 long-term survival of the object will enter the old era.

If the object was born in Eden and after a Minor GC after still alive, and can accommodate Survivor, it will be moved to Survivor space and age is set to 1 .. Survivor objects in every area "get through" a Minor GC, increased age, 1 year old, when his age to a certain extent (default 15 years old), will be promoted to the old era. Threshold settings: -XX: MaxTenuringThreshold.

package GCTest; /** * * -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=15 -XX:+PrintTenuringDistribution * @author lxp * @version 1.0 * @date 2020/1/30 14:22 */ public class TenuringThreshold { private static final int _1MB = 1024 * 1024; public static void main(String[] args) { testTenuringThreold(); } @SuppressWarnings("unused") private static void testTenuringThreold() { byte[] allocation1, allocation2, allocation3; allocation1 = new byte[_1MB / 4]; // 什么时候进入老年代取决于XX:MaxTenuringThreshold设置 allocation2 = new byte[4 * _1MB]; allocation3 = new byte[4 * _1MB]; allocation3 = null; allocation3 = new byte[4 * _1MB]; } }

 

"D:\Program Files\java\jdk1.8\bin\java.exe" -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=15 -XX:+PrintTenuringDistribution "-javaagent:D:\codeSoftWare\idea\IntelliJ IDEA 2019.2.1\lib\idea_rt.jar=51973:D:\codeSoftWare\idea\IntelliJ IDEA 2019.2.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\java\jdk1.8\jre\lib\charsets.jar;D:\Program Files\java\jdk1.8\jre\lib\deploy.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\access-bridge-64.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\cldrdata.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\dnsns.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\jaccess.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\jfxrt.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\localedata.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\nashorn.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunec.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunjce_provider.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunmscapi.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\sunpkcs11.jar;D:\Program Files\java\jdk1.8\jre\lib\ext\zipfs.jar;D:\Program Files\java\jdk1.8\jre\lib\javaws.jar;D:\Program Files\java\jdk1.8\jre\lib\jce.jar;D:\Program Files\java\jdk1.8\jre\lib\jfr.jar;D:\Program Files\java\jdk1.8\jre\lib\jfxswt.jar;D:\Program Files\java\jdk1.8\jre\lib\jsse.jar;D:\Program Files\java\jdk1.8\jre\lib\management-agent.jar;D:\Program Files\java\jdk1.8\jre\lib\plugin.jar;D:\Program Files\java\jdk1.8\jre\lib\resources.jar;D:\Program Files\java\jdk1.8\jre\lib\rt.jar;E:\coding\Practice\out\production\Practice;E:\coding\Practice\lib\asm-5.0.3.jar;E:\coding\Practice\lib\cglib-2.2.jar;E:\coding\Practice\lib\asm-all-7.0.1.jar;E:\coding\Practice\lib\asm-tree-5.0.3.jar;E:\coding\Practice\lib\cglib-nodep-3.2.4.jar;E:\coding\Practice\lib\asm-analysis-5.0.3.jar" GCTest.TenuringThreshold Heap PSYoungGen total 9216K, used 6668K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000) eden space 8192K, 81% used [0x00000000ff600000,0x00000000ffc83138,0x00000000ffe00000) from space 1024K, 0% used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000) to space 1024K, 0% used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000) ParOldGen total 10240K, used 8192K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000) object space 10240K, 80% used [0x00000000fec00000,0x00000000ff400020,0x00000000ff600000) Metaspace used 3448K, capacity 4496K, committed 4864K, reserved 1056768K class space used 376K, capacity 388K, committed 512K, reserved 1048576K Process finished with exit code 0

Since different jdk1.8 perm and 1.6, so PrintTenuringDistribution parameter does not take effect.

3.6.4 Dynamic target age determination.

Age is not necessarily an object must reach a threshold value set menu yet old's promotion, if the sum of the same age Survivor space is larger than half the size of all the objects in space Survivor, age greater than or equal to the object that age you can go directly to the old era.

3.6.4 space allocation guarantees

Continuous space old age is greater than the total size of the new generation of the object or the average size of the previous promotion will be Minor GC, otherwise it will be F ull GC.

 

 

Released three original articles · won praise 0 · Views 519

Guess you like

Origin blog.csdn.net/qq_33383666/article/details/104115098