如果这两种对象存活的时间足够长,在变得无法访问之前被移动到保留区空间中,那么可能会经过很长时间以后才会运行保留区收集,“发现”这个对象已经死亡。
If one of these objects survives long enough to be moved into tenure space before becoming unreachable, it could be a long time before a tenure collection runs and "realizes" that the object is dead.
如果某个对象在几轮复制之后得以幸存,则会将它移动到保留区空间中。
If an object has survived for a number of these copies, it is moved into the tenure area instead.
这会导致闲置空间块变得尽可能的大,但也可能会将关系密切的对象(例如string及其char数据)移动到临近的内存位置。
This results in the largest possible block of free space, but also tends to move objects that are closely related (for example, a String and its char data) into nearby memory locations.
应用推荐