2 Replies Latest reply on Nov 28, 2012 6:14 AM by Nikhil Mone

    jboss cpu spike - GC?

    jboden Newbie

      Hi,

       

      I have a jboss 5.1 app with sun jdk 1.7.something. At night, it runs a large job and gobbles memory. The process gets to 2.5GB and never goes down, but I hear that's normal with heap space? But after a few days of this, I begin to see the cpu spike to 100% of one cpu for a few seconds, then go down. This happens every 5 seconds or so, probably GC?

       

      Using mostly a default run.bat, I have the jvm args set to:

       

      -Xrs -Xms256M -Xmx2048M -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC

      -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

      -Dorg.jboss.resolver.warning=true

       

      Should we be doing something more specific? And if the GC keeps running that often even after the thread to do the nightly job has ended, do I have a memory leak somewhere? We do sometimes run out of memory, but maybe it needs Xmx of 4gb just to finish the job.

       

      I'm going to up the memory anyway, but what clues do we look for to determine if there is a leak and/or better GC settings?

       

      Thank you very much!

      Jim

        • 1. Re: jboss cpu spike - GC?
          Peter Johnson Master

          For suggestions on how to gather GC data and analyze it, see these white papers:

          Java Garbage Collection Statistical Analysis 101

          Java Garbage Collection Performance Analysis 201

            at http://www.cmg.org/cgi-bin/search.cgi?q=java+peter+johnson&x=30&y=10

          • 2. Re: jboss cpu spike - GC?
            Nikhil Mone Newbie

            jboden wrote:

             

            Hi,

             

            I have a jboss 5.1 app with sun jdk 1.7.something. At night, it runs a large job and gobbles memory. The process gets to 2.5GB and never goes down, but I hear that's normal with heap space? But after a few days of this, I begin to see the cpu spike to 100% of one cpu for a few seconds, then go down. This happens every 5 seconds or so, probably GC?

             

            Using mostly a default run.bat, I have the jvm args set to:

             

            -Xrs -Xms256M -Xmx2048M -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC

            -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

            -Dorg.jboss.resolver.warning=true

             

            Should we be doing something more specific? And if the GC keeps running that often even after the thread to do the nightly job has ended, do I have a memory leak somewhere? We do sometimes run out of memory, but maybe it needs Xmx of 4gb just to finish the job.

             

            I'm going to up the memory anyway, but what clues do we look for to determine if there is a leak and/or better GC settings?

             

            Thank you very much!

            Jim

            You can try adding below JAVA options in your "run.bat" to analyse what's wrong with GC :

             

            -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<location of log directory>\gc.log

             

            "gc.log" will contain the information about the collections, if you see a lot of gc activity (mostly FULL GC) when the issue occurs, then you would need to tune your memory/gc settings.