IBM Support

Nursery Size "totalbytes" Does Not Reflect Full -Xmn Value With Gencon Policy

Question & Answer


Question

When using gencon, if -Xmn is set, why is the nursery size "totalbytes" never expanded to ?

Cause

The young generation is a copying collector, therefore a portion of the nursery is reserved to allow a nursery collection to occur. Since that area can not be allocated into, it is not counted as part of the totalbytes of the nursery area.

Answer

Over time the Nursery space tunes itself according to the volume of objects being moved from one region to the other, effectively reaching an optimal value where the reserved space is sized to only accommodate the volume of objects being copied. This tuning is known as "tilting" and it can be observed in the verbosegc output as the current tilt ratio for the nursery space.

The behavior being seen is expected and by design.

Example (note: bytes are converted to MB to help make the example easier to understand):

    genericJvmArguments="...-Xgcpolicy:gencon -Xmn128m..."
    <af type="nursery" id="1" timestamp="Jul 13 02:17:01 2011" intervalms="0.000">
    <minimum requested_bytes="32" />
    <time exclusiveaccessms="0.018" meanexclusiveaccessms="0.018" threads="0" lastthreadtid="0x00000000013DDF00" />
    <refs soft="255" weak="9742" phantom="1" dynamicSoftReferenceThreshold="32" maxSoftReferenceThreshold="32" />
    <nursery freebytes="0" totalbytes="64.000mb" percent="0" />
    <tenured freebytes="383.275mb" totalbytes="384.000mb" percent="99" >
    <soa freebytes="381760624" totalbytes="382521344" percent="99" />
    <loa freebytes="20131840" totalbytes="20131840" percent="100" />
    </tenured>
    <gc type="scavenger" id="1" totalid="1" intervalms="0.000">
    <flipped objectcount="86260" bytes="4577456" />
    <tenured objectcount="0" bytes="0" />
    <finalization objectsqueued="206" />
    <scavenger tiltratio="50" />
    <nursery freebytes="59.395mb" totalbytes="64.000mb" percent="92" tenureage="10" />
    <tenured freebytes="383.275mb" totalbytes="384.000mb" percent="99" >
    <soa freebytes="381760624" totalbytes="382521344" percent="99" />
    <loa freebytes="20131840" totalbytes="20131840" percent="100" />
    </tenured>
    <time totalms="14.063" />
    </gc>

    ...
    ...
    <af type="nursery" id="29" timestamp="Jul 13 02:24:53 2011 intervalms="25786.225">
    <minimum requested_bytes="0.344mb" />
    <time exclusiveaccessms="0.042" meanexclusiveaccessms="0.042" threads="0" lastthreadtid="0x0000000002D02700" />
    <refs soft="8892" weak="11769" phantom="99" dynamicSoftReferenceThreshold="31" maxSoftReferenceThreshold="32" />
    <nursery freebytes="0.172mb" totalbytes="112.019mb" percent="0" />
    <tenured freebytes="288.558mb" totalbytes="384.000mb" percent="75" >
    <soa freebytes="282442672" totalbytes="382521344" percent="73" />
    <loa freebytes="20131840" totalbytes="20131840" percent="100" />
    </tenured>
    <gc type="scavenger" id="29" totalid="33" intervalms="25786.356">
    <flipped objectcount="243566" bytes="11040728" />
    <tenured objectcount="0" bytes="0" />
    <finalization objectsqueued="53" />
    <scavenger tiltratio="87" />
    <nursery freebytes="101.120mb" totalbytes="111.896mb" percent="90" tenureage="12" />
    <tenured freebytes="288.558mb" totalbytes="384.000mb" percent="75" >
    <soa freebytes="282442672" totalbytes="382521344" percent="73" />
    <loa freebytes="20131840" totalbytes="20131840" percent="100" />
    </tenured>
    <time totalms="26.355" />
    </gc>
    <nursery freebytes="100.776mb" totalbytes="111.896mb" percent="90" />
    <tenured freebytes="288.558mb" totalbytes="384.000mb" percent="75" >
    <soa freebytes="282442672" totalbytes="382521344" percent="73" />
    <loa freebytes="20131840" totalbytes="20131840" percent="100" />
    </tenured>
    <refs soft="8892" weak="11536" phantom="99" dynamicSoftReferenceThreshold="31" maxSoftReferenceThreshold="32" />
    <time totalms="26.524" />
    </af>
So even though -Xmn is set to 128MB, initially it shows only 64MB as totalbytes with a tilt ratio 50. That is equal to (128MB * .50 = 64MB). Later on, as the nursery area adjusts to the workload, the free nursery size becomes 111.896MB which is roughly Xmn*tiltRatio=128*.87.

More information can be found in the JVM Diagnostic Guide under the section for "Gencon" GC Policy:

http://www.ibm.com/developerworks/java/jdk/diagnosis/

Related Information

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Java SDK","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.5.5;8.5;8.0;7.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21509538