Question 1.
In the younger generation of Java heap memory, case: If the minor GC occurs, the to survivor area has insufficient space to accommodate the surviving objects from Eden and from survivor. Background: This time there is no age to reach Maxtenuringthreshold object, nor does the same age object size sum of more than half of the survivor space problem: How does Java Virtual opportunity handle this situation? It is supposed to move a part of the object into the old age, so the question is, how many objects will be moved into the old generation?
Question 2.
The book says: In Java heap memory, if the sum of all objects of the same age in Survivor space is greater than half the size of survivor space, then objects older than or equal to that age can enter the old generation directly, No need to wait for the age required in Maxtenuringthreshold. The problem is that each time the GC is minor, the age of the objects in the survivor is added to 1, and the age of the objects from Eden should be 1, so that from a Survivor the object never has the same age that the sum of the size of the object is greater than half of the survivor space occurs, And the only things that can happen are objects from Eden (their age is 1), so if the sum of all objects from the Eden area is greater than half of the survivor space, the objects from Eden and from Survivor will be brought into the next year!!! It feels unreasonable, so I want to know what's wrong with my understanding?
Please help to answer the question?
Two questions about the Java memory mechanism