in most cases in JAVA, objects are allocated in Eden by default, and when GC is triggered, if there is not enough space in survivor, it will be put into the old age.
suppose the following scenario:
eden:80M survivor1:10M survivor2:10M
now survivor2 is empty, and then a total of 6m objects in eden survive, and a total of 5m objects survive in survivor1. Then we have a total of 11m things to survive, and the survivor2 only has a space size of 10m, so it is impossible to copy them all into survivor2. We need the old age, and the question is how many things should be copied into the old era, that is, all 11m things are copied into it. Or do you want to store 10m in survivor2 (assuming that the combination of objects can be just divided into 10m and 1m), and then store the remaining 1m of stuff in the old days. Is there an algorithm? Also, if 6m in eden is an object (that is, an object is 6m, no other objects), and an object in survivor1 is 5m, which objects are copied to survivor2 and which are copied to the old age? Is it stored according to the maximum 6m?