3 Replies Latest reply: Dec 30, 2008 11:20 AM by 843829 RSS

    gc problem (urgent, please help me)

    843829
      Hi all,

      I'm trying to optimize garbage collector for my application running on a Linux box (2.6.18-92.1.13.el5 x86_64) but I have a very strange problem.

      I'm using jdk 1.5.0_16 and my options are:

      -XX:PermSize=192m -XX:MaxPermSize=192m
      -XX:NewSize=768m -XX:MaxNewSize=768m -XX:SurvivorRatio=65536 -XX:MaxTenuringThreshold=0
      -server -Xss128k -Xms2g -Xmx2g -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Xnoclassgc -XX:+UseTLAB
      -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0
      -XX:CMSIncrementalDutyCycle=10 -XX:CMSInitiatingOccupancyFraction=60

      During startup my application allocate a big data structure (of about 300-400mb) and after some second the jvm start a minor collection lasting about 500 seconds.
      During this collection the jvm is completely blocked.

      Using jstat (with 1 second interval) I can see that the time is spent on copying young objects to the tenured generation:

      S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT
      64,0 64,0 0,0 0,0 786304,0 782293,1 1310720,0 42634,5 196608,0 50424,2 1 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 42634,5 196608,0 50468,4 1 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 116528,1 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 185834,0 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 250929,8 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289602,9 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289608,4 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289620,9 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289640,8 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289652,9 196608,0 50468,4 2 0,943 3 0,974 1,917
      S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289679,4 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289727,9 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289760,7 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289794,3 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289810,7 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289822,8 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289850,9 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289875,9 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289899,8 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289915,4 196608,0 50468,4 2 0,943 3 0,974 1,917
      S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289930,6 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289950,1 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289958,0 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289977,9 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 289984,5 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 290001,7 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 290018,5 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 290041,9 196608,0 50468,4 2 0,943 3 0,974 1,917
      64,0 64,0 0,0 0,0 786304,0 786304,0 1310720,0 290050,9 196608,0 50468,4 2 0,943 3 0,974 1,917

      As you can see the old generation usage slowly grow. In this fragment (about 30 second) the collector moved only 200mb.

      Anyone can help me to solve the problem?

      Thank you very much
      Paolo
        • 1. Re: gc problem (urgent, please help me)
          843829
          change command, and test?


          Current:
          -XX:PermSize=192m -XX:MaxPermSize=192m
          -XX:NewSize=768m -XX:MaxNewSize=768m -XX:SurvivorRatio=65536 -XX:MaxTenuringThreshold=0
          -server -Xss128k -Xms2g -Xmx2g -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Xnoclassgc -XX:+UseTLAB
          -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0
          -XX:CMSIncrementalDutyCycle=10 -XX:CMSInitiatingOccupancyFraction=60

          Change:
          -Xms2G -Xmx2G -XX:SurvivorRatio=2 -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
          -Xloggc:gc.log

          and gc analysis.
          • 2. Re: gc problem (urgent, please help me)
            843829
            Too many options you used.
            Observe the IDLE(cpu rate) of the machine, does CPU makes the bottleneck?
            • 3. Re: gc problem (urgent, please help me) (SOLVED)
              843829
              I don't know why, but the problem was related to a library (jdsl) we use to handle a large graph.
              I switched to jgrapht and now the collector works well.

              Paolo