<> When does the object enter the elderly generation ?

* Large objects enter the elderly generation directly .
The virtual machine provides a threshold parameter , Make objects larger than this setting be allocated directly in the older generation . If large objects enter the Cenozoic era , The new generation uses replication algorithms to collect memory , Will result in Eden Area and two Survivor A large number of memory copies occur between partitions , This should be avoided .
* Long lived objects enter the elderly generation . The virtual machine defines an age counter for each object , Object in Eden District birth , Once Minor
GC Still alive after , And can be Survivor If the area can accommodate , Will be moved to Survivor Middle area , The age of the object is set to 1. Then the object is Survivor Every time in the district Minor
GC, Age increases 1, When the age exceeds the set threshold , Will be moved to the older generation .
* Dynamic object age determination : If in Survivor All objects of the same age in the space , Size sum greater than Survivor
Half the space , Then objects older than or equal to this age will directly enter the elderly generation , You don't have to wait until the age required in the threshold .
* Space allocation guarantee : If the maximum available continuous space in the old generation is greater than the total space of all objects in the new generation , that Minor GC
It's safe . If the maximum available continuous space in the old generation is greater than the average size of objects promoted to the old age in previous generations , Just do a risky test Minor GC, If less than average , Proceed Full GC
To make more space for the elderly . Because the new generation uses replication algorithm , For memory utilization , Use only one of them Survivor Space for rotation backup , So if a large number of objects are Minor GC
Still alive after , cause Survivor
Not enough space , Through the distribution guarantee mechanism , Transfer the extra objects to the old age in advance , However, the premise to guarantee in the old age is that they still have the remaining space to accommodate these objects , Because we can't know in advance how many objects will survive , Therefore, take the average size of the objects promoted to the old age as the empirical value , Compare with the remaining space of the elderly generation .

Technology
©2019-2020 Toolsou All rights reserved,
java Comparing attribute values between two objects utilize Python handle Excel data ——xlrd,xlwt library Bidirectional linked list Why? Python Not a future oriented programming language ?Python【 Assignment statement 】 Special lecture , You can't just a=b ah ! Suggest mastering ! utilize Python handle Excel data ——pandas library see SQL-SERVER Data volume and occupied space of database and each table PID The algorithm finally figured out the principle , It was so simple web Two front-end practical games ( Attached source code ) Beginners learn Python Be sure to know what his basic algorithms are ? What is the function ?