This discussion is archived
3 Replies Latest reply: Oct 17, 2012 2:56 AM by Ganesh.. RSS

Java Heap Size problem? Help?

Erdenebayar Newbie
Currently Being Moderated
Hello Everybody,

Now i'm facing very big problem.

I think, about 100 users access to our app, it is stopped.

My configuration below:
XMS_SUN_64BIT="16384"
export XMS_SUN_64BIT
XMS_SUN_32BIT="256"
export XMS_SUN_32BIT
XMX_SUN_64BIT="32768"
export XMX_SUN_64BIT
XMX_SUN_32BIT="512"
export XMX_SUN_32BIT
XMS_JROCKIT_64BIT="16384"
export XMS_JROCKIT_64BIT
XMS_JROCKIT_32BIT="256"
export XMS_JROCKIT_32BIT
XMX_JROCKIT_64BIT="32768"
export XMX_JROCKIT_64BIT
XMX_JROCKIT_32BIT="6144"
export XMX_JROCKIT_32BIT


if [ "${JAVA_VENDOR}" = "Sun" ] ; then
     WLS_MEM_ARGS_64BIT="-Xms16384m -Xmx32768m -XX:NewSize=640m -XX:MaxNewSize=640m -XX:SurvivorRatio=16"
     export WLS_MEM_ARGS_64BIT
     WLS_MEM_ARGS_32BIT="-Xms16384m -Xmx32768m -XX:NewSize=640m -XX:MaxNewSize=640m -XX:SurvivorRatio=16"
     export WLS_MEM_ARGS_32BIT
else
     WLS_MEM_ARGS_64BIT="-Xms16384m -Xmx32768m -XX:NewSize=640m -XX:MaxNewSize=640m -XX:SurvivorRatio=16"
     export WLS_MEM_ARGS_64BIT
     WLS_MEM_ARGS_32BIT="-Xms16384m -Xmx32768m -XX:NewSize=640m -XX:MaxNewSize=640m -XX:SurvivorRatio=16"
     export WLS_MEM_ARGS_32BIT
I installed on linux 64bit, jrocket 64bit, 64GB ram only weblogic running.

How can i configure JVM?

Please help.

BR,
Eba
  • 1. Re: Java Heap Size problem? Help?
    RenévanWijk Oracle ACE
    Currently Being Moderated
    There are different examples given here: http://middlewaremagic.com/weblogic/?page_id=7132

    In the setDomainEnv file you can use USER_MEM_ARGS to override the memory argument, for example,
    ...
    
    if [ "${JAVA_VENDOR}" = "Oracle" ] ; then
         JAVA_HOME="${BEA_JAVA_HOME}"
         export JAVA_HOME
    else
         if [ "${JAVA_VENDOR}" = "Sun" ] ; then
              JAVA_HOME="${SUN_JAVA_HOME}"
              export JAVA_HOME
         else
              JAVA_VENDOR="Oracle"
              export JAVA_VENDOR
              JAVA_HOME="/home/weblogic/jrockit-jdk1.6.0_29-R28.2.2-4.1.0"
              export JAVA_HOME
         fi
    fi
    
    ...
    
    if [ "${SERVER_NAME}" = "" ] ; then
         SERVER_NAME="AdminServer"
         export SERVER_NAME
    fi
    
    if [ "${SERVER_NAME}" = "AdminServer" ] ; then
         # JMX configuration for JRockit
            JMX_OPTIONS="-Djava.rmi.server.hostname=192.168.1.150 -Xmanagement:ssl=false,authenticate=false,port=7091,autodiscovery=true"
            export JMX_OPTIONS
            # Memory arguments for JRockit
            USER_MEM_ARGS="-jrockit -Xms512m -Xmx512m -Xns128m -XXkeepAreaRatio:25 -Xgc:pausetime -XpauseTarget:200ms -XX:+UseCallProfiling -XX:+UseLargePagesForHeap ${JMX_OPTIONS}"
            export USER_MEM_ARGS
    fi
    Above an example is shown for JRockit. Xms and Xmx can be set accordingly (with a hundred users 4096m would probably be enough).
  • 2. Re: Java Heap Size problem? Help?
    Erdenebayar Newbie
    Currently Being Moderated
    Thank you for your quick reply.

    I'll try and let you know. But what about my configuration? Is it OK? or Should i change to 4096m?
    Like:
    XMS_JROCKIT_64BIT="4096"
    export XMS_JROCKIT_64BIT
    XMX_JROCKIT_64BIT="4096"
    export XMX_JROCKIT_64BIT
    
    ....
    
    WLS_MEM_ARGS_64BIT="-Xms4096m -Xmx4096m -XX:NewSize=640m -XX:MaxNewSize=640m -XX:SurvivorRatio=16"
    export WLS_MEM_ARGS_64BIT
    
    ....
    
    MEM_PERM_SIZE_64BIT="-XX:PermSize=256m"
    export MEM_PERM_SIZE_64BIT
    
    ...
    
    MEM_MAX_PERM_SIZE_64BIT="-XX:MaxPermSize=1024m"
    export MEM_MAX_PERM_SIZE_64BIT
    
    ...
    
    USER_MEM_ARGS="-jrockit -Xms4096m -Xmx4096m -Xns128m -XXkeepAreaRatio:25 -Xgc:pausetime -XpauseTarget:200ms -XX:+UseCallProfiling -XX:+UseLargePagesForHeap ${JMX_OPTIONS}"
    export USER_MEM_ARGS
    Also i little bit confused with XMX_JROCKIT_64BIT, WLS_MEM_ARGS_64BIT and USER_MEM_ARGS arguments. Is it same configuration or different purpose?

    Thank you,
    Eba
  • 3. Re: Java Heap Size problem? Help?
    Ganesh.. Explorer
    Currently Being Moderated
    Hi,
    First of all there is no need to add '4096m' in

    XMS_JROCKIT_64BIT="4096"
    export XMS_JROCKIT_64BIT
    XMX_JROCKIT_64BIT="4096"
    export XMX_JROCKIT_64BIT

    Instead of modifying and keeping track of what all parameters you have changed, I would recommend to specify the parameters at a single place (generally at the bottom of file) to put manully changed parameters.
    e.g.
    MEM_ARGS="-XXaggressive -Xms32768m -Xmx32768m -Xgc:pausetime -XXnosystemgc -XXcompaction:percentage=2 -XXtlaSize:wasteLimit=16k,min=16k,preferred=128k -Djrockit.codegen.newlockmatching=true -Djbo.load.components.lazily=true -Xmanagement:port=7094,ssl=false,authenticate=false"
    JAVA_OPTIONS="${JAVA_OPTIONS} -Djps.combiner.optimize.lazyeval=false -Djps.policystore.hybrid.mode=false -XX:+UseLargePagesForHeap"
    export JAVA_OPTIONS

    You can specify this at the end of the file. If you want to modify any parameter later on, you can keep track of changed parameters.
    Also whatever MEM_ARGS you specify here will override the arguments which are already provided before this.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points