Home


kCluster, pCluster, and fragmentation

Java objects located in the Java heap are usually mobile; that is, the garbage collector (GC) can move them around if it decides to re-sequence the heap. Some objects, however, cannot be moved either permanently or temporarily. Such immovable objects are known as pinned objects. One kind of situation to look out for, which is associated with pinning memory, is the use of the JNI to call external programs. Use of JDBC-2 drivers is a case in point.

In the Java SDK Release 1.3.1, Service Refresh 7 and above, the garbage collector (GC) allocates what is called a kCluster as the first region at the bottom of the heap. A kCluster is an area of storage that is used exclusively for class blocks. It is large enough to hold 1280 entries and each class block is 256 bytes long.

The GC then allocates a pCluster as the second object on the heap. A pCluster is an area of storage that is used to allocate any pinned objects. It is 16 KB long.

When the kCluster is full, the GC allocates class blocks in the pCluster. When the pCluster is full, the GC allocates a new pCluster of 2 KB. Because this new pCluster can be allocated anywhere in the heap and must be pinned, it can lead to fragmentation problems.

+

Search Tips   |   Advanced Search