4 Replies Latest reply on Mar 11, 2007 7:04 PM by lafr

    High CPU consumption.

      Hello,

      We have just migrated from HP/UX to Linux (SUSE AMD 4CPU) and after a couple of hours we can see a large consumption of CPU (>200%).
      This problem has never appears before this migration.

      We use the JDK1.5.0_11, and the parameters for the JVM are : -server -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

      Have you an idea of this problem? Does exist some tuning for Jboss on Linux ?

      Thanks,
      Jerome

        • 1. Re: High CPU consumption.
          peterj

          The best thing to do is take some thread dumps when you see the unexpected processor usage. Those should tell you what is running.

          • 2. Re: High CPU consumption.
            lafr

            Execute "jmap -heap " to see the memory use.
            If the memory use reaches 100% the server is constantly running garbage collections which consume many CPU cycles.
            Perhaps you'll have to adjust the memory settings on startup.

            • 3. Re: High CPU consumption.

              Hello,

              Thanks for your help.

              Here is a result of the command 'jmap -heap', could you help me to interpret this result, and to optimize my parameters?

              Best Regards,
              Jerome.

              Attaching to process ID 11776, please wait...
              Debugger attached successfully.
              Server compiler detected.
              JVM version is 1.5.0_11-b03

              using parallel threads in the new generation.
              using thread-local object allocation.
              Mark Sweep Compact GC

              Heap Configuration:
              MinHeapFreeRatio = 40
              MaxHeapFreeRatio = 70
              MaxHeapSize = 2147483648 (2048.0MB)
              NewSize = 2686976 (2.5625MB)
              MaxNewSize = -65536 (-0.0625MB)
              OldSize = 1835008 (1.75MB)
              NewRatio = 2
              SurvivorRatio = 8
              PermSize = 21757952 (20.75MB)
              MaxPermSize = 134217728 (128.0MB)

              Heap Usage:
              New Generation (Eden + 1 Survivor Space):
              capacity = 644218880 (614.375MB)
              used = 581578344 (554.6363296508789MB)
              free = 62640536 (59.738670349121094MB)
              90.27651347318476% used
              Eden Space:
              capacity = 572653568 (546.125MB)
              used = 572344744 (545.8304824829102MB)
              free = 308824 (0.29451751708984375MB)
              99.94607140909318% used
              From Space:
              capacity = 71565312 (68.25MB)
              used = 9233600 (8.80584716796875MB)
              free = 62331712 (59.44415283203125MB)
              12.902340172847985% used
              To Space:
              capacity = 71565312 (68.25MB)
              used = 0 (0.0MB)
              free = 71565312 (68.25MB)
              0.0% used
              tenured generation:
              capacity = 1431699456 (1365.375MB)
              used = 254001848 (242.23503875732422MB)
              free = 1177697608 (1123.1399612426758MB)
              17.741282706752667% used
              Perm Generation:
              capacity = 80216064 (76.5MB)
              used = 80136544 (76.42416381835938MB)
              free = 79520 (0.075836181640625MB)
              99.90086773641748% used

              • 4. Re: High CPU consumption.
                lafr

                You set the MaxPermSize but not the starting value: add "-XX:NewSize=128m" to the parameter list.
                Don't know much about the flags "-XX:+UseParNewGC" and "-XX:+CMSParallelRemarkEnabled" and JBoss on Linux, but I would try to run without it.
                JDK 1.5 checks the system for available CPUs and memory and set's values based on that.

                You also may add "-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:-TraceClassUnloading" to see GC messages and see if there are messages generated constantly when the CPU load increases.