Object X is an object that is included in the Explicit memory block targeted for releasing. The description given below takes object X as an example. The following figure shows the operation if an object is being referenced from outside when releasing the Explicit memory block.įigure 8-14 Operation if an object is being referenced from outside when releasing the Explicit memory block Even if the reference source object is in the Explicit memory block that is targeted for releasing, if the object is going to be moved in the Java heap without destroying, the object being referenced is also not deleted. If the objects are being referenced from Explicit memory blocks that are not targeted for releasing If an object is being referenced from an object in the Explicit memory block, which is not targeted for releasing, the object is not destroyed. Even if an object is being referred from an object in the Tenured area that is already not in use, the object is targeted for moving.
The corresponding objects are preferentially moved to a Tenured area in the Java heap However, the objects are moved to a New area if there is no free space in the Tenured area or if the Tenured area has overflown. If an object is being referenced from the Java heap or the Permanent area If an object is being referenced from an object in the Java heap or the Permanent area, the object is not destroyed. Explicit memory block which is not targeted for releasingĮxecuted details in each case are described below.This corresponds to the case when the objects in the Explicit memory block, which are targeted for releasing, are being referenced from the objects in the following areas: (a) If the objects are being referenced from outside (from a location other than the Explicit memory blocks that are targeted for releasing) If objects in Explicit memory blocks, which are targeted for releasing, correspond to the following conditions, the operation will be different. The objects are registered in the finalize queue and moved to the Java heap.
However, the objects, which are implementing the finalize method and which are not being referenced from anywhere, from among the objects in Explicit memory blocks to be released, are not destroyed. At that time, the objects inside the released Explicit memory blocks are destroyed. The Explicit memory blocks are released by the memory releasing API of the OS. If one or more corresponding Explicit memory blocks exist, those Explicit memory blocks are released.
After the copy garbage collection or full garbage collection processing is over, an investigation is performed to check the existence of the Explicit memory blocks that JavaVM has reserved for release.