6 Replies Latest reply on Jun 6, 2014 1:47 PM by wdfink

    Garbage Collector Configurations in JBOSS 7

    murthy516

      Hi,

       

         I'm starting the JBOSS Script using JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Duser.timezone=IST -Xmx6144m -XX:MaxPermSize=1536m -XX:ReservedCodeCacheSize=256m -Dsun.rmi.dgc.client.gcInterval=1800000 -Dsun.rmi.dgc.server.gcInterval=1800000 -XX:+UseConcMarkSweepGC".

       

      I've a huge transactions which will take around 2 hours to complete.Even after the transaction completes,the used memory is not getting released.I waited for 5 hours.But,the heap memory is still not getting released.Code doesn't have any loop holes..Any problem in above configs?

       

      Pls help me out

       

      Regards

      Krsv

        • 1. Re: Garbage Collector Configurations in JBOSS 7
          pmm

          Does a full gc happen? If not does the memory get released if you manually trigger a full gc.

           

          If the memory does not get released after a full gc you have a memory leak and the gc settings are irrelevant. If simply no full gc happens then this is "normal".

          • 2. Re: Garbage Collector Configurations in JBOSS 7
            murthy516

            Hi,

                 Full GC has not happened even after 5 hours.I've triggered manually System.gc() through code,and the performance of all transactions is very low which is unacceptable.But,the memory consumption is low.But JBOSS gc is not being called which is resulting in Memory Heap Issue.

             

            Help me out.:-(

             

            Krsv

            • 3. Re: Garbage Collector Configurations in JBOSS 7
              wdfink

              You might use JConsole or visualGC to force a GC and check what is released.

              At runtime you might use jstat as this will not add a big impact to the running JVM.

               

              If you don't see that the heap utilization go back to the number which was used before the long batch you might take a heap dump and analyze it to see which objects are using the memory.

              Maybe you store a reference which is not freed and is the start point to a big reference graph

              • 4. Re: Garbage Collector Configurations in JBOSS 7
                ctomc

                What OS / JVM is this?

                 

                looking at your JVM settings, set Xms to same value as Xmx this is best for performance.

                also are you sure you need 1.5GB Permgen size? this looks huge and unless your deployment if few hundred megabytes looks like mistake.

                • 5. Re: Garbage Collector Configurations in JBOSS 7
                  murthy516

                  Hi Tomaz,

                   

                          Thanks for your response.Ok,we will set the Xms and Xmx to same value and monitor the application for few days.I need Permanent Heap Memory more,as it is an enterprise application where heavy load can be there on server with huge number of transactions.Suggest me the PermSize.

                   

                  OS is

                  Red Hat Enterprise Linux Server release 5.10 (Tikanga)

                   

                  Java 1.7.0

                   

                  Regards

                  Krsv

                  • 6. Re: Garbage Collector Configurations in JBOSS 7
                    wdfink

                    PermSize is only used for very permanent objects like loaded classes.

                    If you have transactions - this mean objects created by a long running service - they might go from Young->Survivor->OldGen but from the OldGen they will be removed after the process finished.

                    There is no need for a big PermGen.

                    You might watch it with the jstat command