1 Reply Latest reply: Sep 13, 2005 2:15 AM by 3004 RSS

    JVM tuning Xms Xmx etc

    666705
      Hi,

      We are using weblogic 8.1 sp3 with the jdk1.4.2_05 (we do not use jrocket) for the implementation of some of our solutions.
      We are trying to optimize performance generally on servers with 2 processors and 4-8Gb of RAM, and some exceptions such as for instance a test-machine we have at the moment with 4 processors and 20 Gb of RAM.

      Although we seem to be able to improve performance by raising the settings for Xms and Xmx to 1024m ( even though our development tests done in the labs in Cary, NC - USA have resulted in recommendations that show lower values ) we would like to have some more info because not all info we have points to the same directions. For instance
      1. What are theoretically the maximum values for these settings (in particular Xms and Xmx)?
      2. Should Xms and Xmx be set to the same value (as mentioned in info from your website - see below), or are there situations where different values could improve performance ?
      3. Is there other general advice you can give for improving performance using these settings ?

      Extra info pices inserted below.

      Kind regards,
      Jos van der Velden
      SAS Portugal
      *********************************************************EXTRA_INFO_1

      Setting WebLogic Managed Server Memory Arguments
      The following memory arguments for the WebLogic Managed Server are recommended by development:

      -server –Xms512m –Xmx512m –XX:NewSize=64m

      –XX:MaxNewSize=64m –XX:MaxPermSize=128m –Xss128k

      -XX:-UseTLAB –XX:+UseConcMarkSweepGC

      -XX:+UseCMSCompactAtFullCollection

      -XX:+DisableExplicitGC

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

      -Djava.awt.headless=true

      -Djava.security.manager

      These options can be specified via the WebLogic Administrator Console in the Arguments field under the Remote Start tab in the properties for the WebLogic Managed Server.

      source: SAS installation manual (draft version)
      *********************************************************EXTRA_INFO_2

      Argument
      Description

      -Xms and -Xmx
      Specify the minimum and maximum values (in megabytes) for Java heap memory.

      For example, you may want to start the server with a default allocation of 200 megabytes of Java heap memory to the WebLogic Server. To do so, you can start the server with the java -Xms200m and -Xmx200m options.

      For best performance it is recommended that the minimum and maximum values be the same so that the JVM does not resize the heap.

      The values assigned to these parameters can dramatically affect the performance of your WebLogic Server and are provided here only as general defaults. In a production environment you should carefully consider the correct memory heap size to use for your applications and environment.


      source: http://e-docs.bea.com/wls/docs70/adminguide/startstop.html

      *********************************************************EXTRA_INFO_3

      set MEM_ARGS=[-XmsNumberm] [-XmxNumberm]

      where Number is a numerical value in megabytes (MB). The-XmsNumberm argument establishes a minimum heap size for the JVM and the -XmxNumberm sets a maximum heap size. By default, the minimum heap size is 23 MB and the maximum heap size is 200 MB.

      source: http://e-docs.bea.com/wls/docs81/adminguide/winservice.html#1192313

      *********************************************************EXTRA_INFO_4
      Java Heap Size Options
      You achieve best performance by individually tuning each application. However, configuring the Java HotSpot VM heap size options listed in Table 3-2 when starting WebLogic Server increases performance for most applications.

      These options may differ depending on your architecture and operating system. See your vendor's documentation for platform-specific JVM tuning options.

      Table 3-2 Java Heap Size Options
      Task
      Option
      Recommended Value

      Setting the New generation heap size
      -XX:NewSize
      Set this value to a multiple of 1024 that is greater than 1MB. As a general rule, set -XX:NewSize to be one-fourth the size of the maximum heap size. Increase the value of this option for larger numbers of short-lived objects.

      Be sure to increase the New generation as you increase the number of processors. Memory allocation can be parallel, but garbage collection is not parallel.

      Setting the maximum New generation heap size
      -XX:MaxNewSize
      Set this value to a multiple of 1024 that is greater than 1MB.

      Setting New heap size ratios
      -XX:SurvivorRatio
      The New generation area is divided into three sub-areas: Eden, and two survivor spaces that are equal in size.

      Configure the ratio of the Eden/survivor space size. Try setting this value to 8, and then monitor your garbage collection.

      Setting minimum heap size
      -Xms
      Set the minimum size of the memory allocation pool. Set this value to a multiple of 1024 that is greater than 1MB. As a general rule, set minimum heap size (-Xms) equal to the maximum heap size (-Xmx) to minimize garbage collections.

      Setting maximum heap size
      -Xmx
      Set the maximum size of the memory allocation pool. Set this value to a multiple of 1024 that is greater than 1MB.

      Note: For information about setting the appropriate heap sizes for WebLogic's JRockit JVM, see WebLogic JRockit Documentation.

      source: http://e-docs.bea.com/wls/docs81/perform/JVMTuning.html#1115453
        • 1. Re: JVM tuning Xms Xmx etc
          3004
          <Jos van der Velden> wrote in message news:600011589@newsgroups.bea.com...
          Hi,

          We are using weblogic 8.1 sp3 with the jdk1.4.2_05 (we do not use jrocket) for the implementation of some of our solutions.
          We are trying to optimize performance generally on servers with 2 processors and 4-8Gb of RAM, and some exceptions such as for
          instance a test-machine we have at the moment with 4 processors and 20 Gb of RAM.
          >
          Although we seem to be able to improve performance by raising the settings for Xms and Xmx to 1024m ( even though our development
          tests done in the labs in Cary, NC - USA have resulted in recommendations that show lower values ) we would like to have some more
          info because not all info we have points to the same directions. For instance
          1. What are theoretically the maximum values for these settings (in particular Xms and Xmx)?
          Theoretically the maximum is a memory space addressable by a process.

          2. Should Xms and Xmx be set to the same value (as mentioned in info from your website - see below), or are there situations where
          different values could improve performance ?


          For a production environment Xms and Xmx should be equal so that JVM doesn't
          spend time shrinking and expanding heap.

          3. Is there other general advice you can give for improving performance using these settings ?
          Generally it is a good idea to keep heap under 1G. Bigger heap means longer GC-s.
          You may consider co-locating cluster nodes running in separate JVMs if you have
          enough CPUs and extensive RAM. Generally 2 CPUs per weblogic instance is enough.


          Regards,


          Slava Imeshev