3 Replies Latest reply on Jun 6, 2009 5:55 PM by peterj

    Jboss memory settings on 64 bit server

    ozguy

      Hi,
      I am in the process of setting up Jboss Server in a clustered mode using Jboss 4.2.3 and portal 2.6.7.

      Just been playing around with the memory settings and wanted to see if any of you have any opinion on the memory settings i currently have.

      I have 2 64 bit servers running Java 1.5.0.19 and with a RAM of 24G on Centos OS

      This is what i have currently done.
      1. Setup OS to use large/huge TLB. I think the sys admin has set this up to 18G.

      2. i have been playing around with the heap/memory settings and this is what i currently have:
      #Memory Settings
      JAVA_OPTS=" -d64 -Dsun.rmi.dgc.client.gcInterval=1800000 -Dsun.rmi.dgc.server.gcInterval=1800000 -Xms15g -Xmx15g -XX:PermSize=1g -XX:MaxPermSize=1g -XX:ReservedCodeCacheSize=256m -XX:NewSize=6g -XX:MaxNewSize=6g -XX:+UseLargePages"

      #Garbage Collector settings
      JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:MaxGCPauseMillis=500 -XX:+CMSIncrementalMode"

      #extra settings
      JAVA_OPTS="$JAVA_OPTS -server -Xss128k -Djboss.serverPeerID=$ServerPeerID -Djboss.partition.name=$partitionName -Dportal.hibernate.cache.partition.name=$hibernateCache -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:/var/log/jboss/jvmgcc/gcc.txt "



      Does any of you have any suggestion on the above settings ?

        • 1. Re: Jboss memory settings on 64 bit server
          peterj

          Do you really needs 16GB of heap? Have you done any performance testing to see what the actual memory requirements are? Cleaning up a 16GB heap, or even a 1GB young generation, will take time. And using the CMS collector will not reduce the young generation pauses. The CMS collector does pause the app twice for object marking; I have no idea how long it will take to mark a 16 GB heap.

          Ideally, you want the smallest heap possible that does not greatly negatively impact your performance. In this case I think you have run into the "more is not better" anti-pattern.

          • 2. Re: Jboss memory settings on 64 bit server
            ozguy

            Hi Peter,

            reason i have heap set high was to avoid out of memory exceptions.
            Whats the best way to use the 24g RAM that is available.

            We are running lot of Web Apps and they all need to store large amount of data such as session objects etc thats why i am using 16g heap.

            If i restrict the heap size to say 4g, than there is 20G ram not used by the server at all. Is this assumption correct?

            • 3. Re: Jboss memory settings on 64 bit server
              peterj

              Yes, if JBoss AS is the only thing running, and you allocate only a 4GB heap, then around 20GB of RAM will be unused. Actually, more like 18 or 19GB because the OS and various services will use some memory, the Java threads will use memory, the JVM will use memory, etc. There were some recent posts on how he JVM consumes memory.

              I still stand by my statements on heap sizing - a too large heap is as bad as a too small heap. There is an ideal heap size for your apps, but without monitoring the heap usage you will never know what it is.