IBM User Guide for Java V7 on Windows > IBM SDK for Java > The collector and the allocator > Balanced Garbage Collection policy
Partial Garbage Collection
A Partial Garbage Collection (PGC) reclaims memory by using either a Copy-Forward or Mark-Compact operation on the Java™ heap.
Note: The -Xpartialcompactgc option, which in previous version of IBM Java enabled partial compaction, is now deprecated and has no effect if used.
When the eden space is full, the application is stopped. A PGC runs before allocating another set of empty regions as the new eden space. The application can then proceed. A PGC is a "stop-the-world" operation, meaning that all application threads are suspended until it is complete. A PGC can be run on any set of regions in the heap, but always includes the eden space, used for allocation since the previous PGC. Other regions can be added to the set based on factors that include age, free memory, and fragmentation.
Because a PGC looks only at a subset of the heap, the operation might miss opportunities to reclaim dead objects in other regions. This problem is resolved by a Global Mark Phase (GMP).
In this example, regions A and B each contain an object that is reachable only through an object in the other region:
If only A or B is collected, one half of the cycle keeps the other alive. However, a GMP can see that these objects are unreachable.
The Balanced policy can use either a Copy-Forward (scavenge) collector or a Mark-Compact collector in the PGC operation. Typically, the policy favors Copy-Forward but can change either partially or fully to Mark-Compact if the heap is too full. You can check the verbose Garbage Collection logs to see which collection strategy is used.
Copy-Forward operation
These examples show a PGC operation using Copy-Forward, where the shaded areas represent live objects, and the white areas are unused:
This diagram shows the Java heap before the Copy-Forward operation:
![]()
This diagram shows the Java heap during the Copy-Forward operation, where the arrows show the movement of objects:
![]()
This diagram shows the Java heap after the Copy-Forward operation, where region ages have been incremented:
![]()
Mark-Compact operation
These examples show a PGC operation using Mark-Compact, where the shaded areas represent live objects, and the white areas are unused.
This diagram shows the Java heap before the Mark-Compact operation:
![]()
This diagram shows the Java heap during the Mark-Compact operation, where the arrows show the movement of objects:
![]()
This diagram shows the Java heap after the Mark-Compact operation, where region ages have been incremented:
![]()
Parent: Balanced Garbage Collection policy
Error 404 - Not Found Error 404 - Not Found
The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.