Results 1 to 5 of 5
  1. #1
    daromnet is offline Member
    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0

    Default JVM Garbage Collection

    I am analyzing GC logs. Can anyone explain me why allocation failure occurring before the heap gets to max?

    JVM parameters are Xms512M, Xmx3072 Xmine30m. I am running an application on Tomcat 5.5.29 on AIX. It is IBM JVM. Here is a fragment of a GC log file.

    Appreciate your help.

    <af type="tenured" id="1" timestamp="Mar 02 10:28:35 2011" intervalms="0.000">
    <minimum requested_bytes="48" />
    <time exclusiveaccessms="0.038" meanexclusiveaccessms="0.038" threads="0" lastthreadtid="0x0000000113819300" />
    <refs soft="4789" weak="5837" phantom="2" dynamicSoftReferenceThreshold="32" maxSoftReferenceThreshold="32" />
    <tenured freebytes="26843136" totalbytes="536870912" percent="4" >
    <soa freebytes="0" totalbytes="510027776" percent="0" />
    <loa freebytes="26843136" totalbytes="26843136" percent="100" />
    </tenured>
    <gc type="global" id="1" totalid="1" intervalms="0.000">
    <classunloading classloaders="0" classes="0" timevmquiescems="0.000" timetakenms="1.044" />
    <finalization objectsqueued="1882" />
    <timesms mark="36.154" sweep="2.638" compact="0.000" total="39.984" />
    <tenured freebytes="506061976" totalbytes="536870912" percent="94" >
    <soa freebytes="479218840" totalbytes="510027776" percent="93" />
    <loa freebytes="26843136" totalbytes="26843136" percent="100" />
    </tenured>
    </gc>
    <tenured freebytes="506061928" totalbytes="536870912" percent="94" >
    <soa freebytes="479218792" totalbytes="510027776" percent="93" />
    <loa freebytes="26843136" totalbytes="26843136" percent="100" />
    </tenured>
    <refs soft="4647" weak="3012" phantom="2" dynamicSoftReferenceThreshold="30" maxSoftReferenceThreshold="32" />
    <time totalms="47.831" />
    </af>
    Last edited by daromnet; 03-04-2011 at 05:34 PM. Reason: edditing

  2. #2
    couling is offline Member
    Join Date
    Nov 2010
    Posts
    54
    Rep Power
    0

    Default

    Looks like the small object area (SOA) ran out of space. You may find this link helpful: Resizing the LOA

    Hope this helps.
    ----Signature ----
    Please use [CODE] tags and indent correctly. It really helps when reading your code.

  3. #3
    daromnet is offline Member
    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0

    Default

    couling,

    Thanks for the reference. Actually, I want to know why GC occur before new space allocation. In my example, allocation failure happens when total used 536K. Heap can grow up to 3G. Instaed of allocating more memory, JVM does GC.

    Thanks.

  4. #4
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,937
    Rep Power
    19

    Default

    Depends.
    How old are those objects that it's cleaned up?
    If they're young then that's a fairly easy sweep.
    No point grabbing more memory if it's not needed.

    This is why production systems will generally have Xms and Xmx set the same. Since you plan on eventually giving the JVM Xmx may as well do that from the start.

  5. #5
    lovelesh is offline Senior Member
    Join Date
    Nov 2010
    Location
    Delhi
    Posts
    135
    Blog Entries
    1
    Rep Power
    0

    Post

    Quote Originally Posted by Tolls View Post
    Depends.
    No point grabbing more memory if it's not needed.
    Very rightly said.

    To add to it, the allocation of new memory and reclaiming memory also depends on the algorithm implemented by the jvm.

Similar Threads

  1. Garbage Collector tuning
    By javaOrC in forum Advanced Java
    Replies: 45
    Last Post: 03-02-2011, 11:51 PM
  2. In defense of the Garbage Collector
    By Katanagas in forum Advanced Java
    Replies: 2
    Last Post: 10-25-2010, 06:40 PM
  3. Garbage Collector Doubt
    By CristOm in forum New To Java
    Replies: 9
    Last Post: 05-04-2010, 11:26 AM
  4. Q about Garbage Collector
    By m00nchile in forum New To Java
    Replies: 4
    Last Post: 02-05-2010, 05:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •