Topic
12 replies Latest Post - ‏2006-05-31T12:29:17Z by SystemAdmin
SystemAdmin
SystemAdmin
37422 Posts
ACCEPTED ANSWER

Pinned topic Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and Xms options

‏2005-07-07T04:41:26Z |
Hi all,

I'm new to WebSphere Appl. Server, so I'm having hard times.

Simply, I want to start application server with my own memory (heap) settings. For example, I want the server process launched as a java executable to have 16MB Xms and 64MB Xmx values.

First, I tried to do this thru admin console (Servers->server1->Java and Process Management->Process Definition->JVM-> Initial & Maximum Heap Size). However, regardless of different values I provide, the java process began with a random value. For example,

(init,max) -> the mem usage seen at the task manager (Win XP) for the corresponding java.exe:

(64,64)-> ~143MB (I also supplied as bytes, i.e. 64000000)
(novalue,novalue) -> ~128MB
(0,0) -> ~154MB

Second, I changed the server.xml config file manually (into which the admin console also writes), and of course, unfortunately no change.

Third, I add -Xmx and -Xms values (e.g. -Xms16M -Xmx64M) into startServer.bat file under ..\AppServer\bin

"%JAVA_HOME%\bin\java" %WAS_TRACE% %WAS_DEBUG% %CONSOLE_ENCODING% "%CLIENTSAS%" "-classpath" "%WAS_CLASSPATH%" "-Dws.ext.dirs=%WAS_EXT_DIRS%" "-Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager" "-Djava.util.logging.configureByServer=true" %USER_INSTALL_PROP% "-Dwas.install.root=%WAS_HOME%" "-Dibm.websphere.preload.classes=true" [b]-Xms16m -Xmx64m[/b] "com.ibm.ws.bootstrap.WSLauncher" "com.ibm.ws.management.tools.WsServerLauncher" "%CONFIG_ROOT%" "%WAS_CELL%" "%WAS_NODE%" %*

But it didn't work either.

In conclusion, I'm really getting hopeless. Is there any way to set Xms and Xmx values of the server process?

I'll really appretiate any help. Thanks in advance...

Oguzhan
Updated on 2006-05-31T12:29:17Z at 2006-05-31T12:29:17Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    37422 Posts
    ACCEPTED ANSWER

    Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and Xms options

    ‏2005-07-07T05:05:20Z  in response to SystemAdmin
    What version of WAS?

    oozmen@uwaterloo.ca wrote:
    > Hi all,
    >
    > I'm new to WebSphere Appl. Server, so I'm having hard times.
    >
    > Simply, I want to start application server with my own memory (heap) settings. For example, I want the server process launched as a java executable to have 16MB Xms and 64MB Xmx values.
    >
    > First, I tried to do this thru admin console (Servers->server1->Java and Process Management->Process Definition->JVM-> Initial & Maximum Heap Size). However, regardless of different values I provide, the java process began with a random value. For example,
    >
    > (init,max) -> the mem usage seen at the task manager (Win XP) for the corresponding java.exe:
    >
    > (64,64)-> ~143MB (I also supplied as bytes, i.e. 64000000)
    > (novalue,novalue) -> ~128MB
    > (0,0) -> ~154MB
    >
    > Second, I changed the server.xml config file manually (into which the admin console also writes), and of course, unfortunately no change.
    >
    > Third, I add -Xmx and -Xms values (e.g. -Xms16M -Xmx64M) into startServer.bat file under ..\AppServer\bin
    >
    > "%JAVA_HOME%\bin\java" %WAS_TRACE% %WAS_DEBUG% %CONSOLE_ENCODING% "%CLIENTSAS%" "-classpath" "%WAS_CLASSPATH%" "-Dws.ext.dirs=%WAS_EXT_DIRS%" "-Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager" "-Djava.util.logging.configureByServer=true" %USER_INSTALL_PROP% "-Dwas.install.root=%WAS_HOME%" "-Dibm.websphere.preload.classes=true" [b]-Xms16m -Xmx64m[/b] "com.ibm.ws.bootstrap.WSLauncher" "com.ibm.ws.management.tools.WsServerLauncher" "%CONFIG_ROOT%" "%WAS_CELL%" "%WAS_NODE%" %*
    >
    > But it didn't work either.
    >
    > In conclusion, I'm really getting hopeless. Is there any way to set Xms and Xmx values of the server process?
    >
    > I'll really appretiate any help. Thanks in advance...
    >
    > Oguzhan
    • SystemAdmin
      SystemAdmin
      37422 Posts
      ACCEPTED ANSWER

      Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and<br> Xms options

      ‏2005-07-07T15:58:52Z  in response to SystemAdmin
      > What version of WAS?

      I'm using v6.0. Do you think lower versions don't have such problems? I think I can try to install an older-trial version, and test.
      • SystemAdmin
        SystemAdmin
        37422 Posts
        ACCEPTED ANSWER

        Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and<br> Xms options

        ‏2005-07-07T16:46:28Z  in response to SystemAdmin
        oozmen@uwaterloo.ca wrote:

        >
        >
        >>What version of WAS?
        >>
        >>
        >
        >I'm using v6.0. Do you think lower versions don't have such problems? I think I can try to install an older-trial version, and test.
        >
        >
        >
        Every JVM will appear to have such problems. Java Heap != process size.

        Ken
        • SystemAdmin
          SystemAdmin
          37422 Posts
          ACCEPTED ANSWER

          Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and<br><br> Xms options

          ‏2005-07-08T11:22:12Z  in response to SystemAdmin
          Ken,
          Is this related to the overcommitment (in linux). When you malloc some Kb, it only get used when you use it.
          is it the scenario?

          []'s
          Breno Leitão
          • SystemAdmin
            SystemAdmin
            37422 Posts
            ACCEPTED ANSWER

            Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and<br><br> Xms options

            ‏2005-07-08T13:33:10Z  in response to SystemAdmin
            bhleitao@cpqd.com.br wrote:

            >Ken,
            > Is this related to the overcommitment (in linux). When you malloc some Kb, it only get used when you use it.
            > is it the scenario?
            >
            >[]'s
            >Breno Leitão
            >
            >
            Can be, though the more common situation is what I put in my other post
            • process size > heap size.

            Ken
  • SystemAdmin
    SystemAdmin
    37422 Posts
    ACCEPTED ANSWER

    Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and Xms options

    ‏2005-07-07T05:49:34Z  in response to SystemAdmin
    The Task Manager is not a good indication of the heap usage: heap is only a
    part of native memory usage.

    To confirm the settings are taken into account, get Process Explorer from
    SysInternals and look at the exact command line arguments of the process.

    • SystemAdmin
      SystemAdmin
      37422 Posts
      ACCEPTED ANSWER

      Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and Xms options

      ‏2005-07-07T16:24:40Z  in response to SystemAdmin
      > The Task Manager is not a good indication of the heap
      > usage: heap is only a
      > part of native memory usage.
      >
      > To confirm the settings are taken into account, get
      > Process Explorer from
      > SysInternals and look at the exact command line
      > arguments of the process.
      >

      Thanks for the reply.

      I downloaded and installed Process Explorer. As you said I looked at the command-line of the server process. I obtained some interesting results.

      First, (using adminconsole) I gave novalue to initial and Max Heapsizes (I confirmed by checking these in the server.xml file), and the commandline was:

      (novalue,novalue)-> 129,728K (Process Expl-Working Set) and 129,504K(Task Mang. Mem Usage)

      [i]"C:\Program Files\IBM\WebSphere\AppServer/java/bin/java"
      "-Xbootclasspath/p:C:\Program Files\IBM\WebSphere\AppServer/java/jre/lib/ext/ibmorb.jar;C:\Program iles\IBM\WebSphere\AppServer/java/jre/lib/ext/ibmext.jar"

      -Dwas.status.socket=1694

      -classpath "C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile/properties;C:\Program Files\IBM\WebSphere\AppServer/properties;C:\Program Files\IBM\WebSphere\AppServer/lib/bootstrap.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/j2ee.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/lmproxy.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/urlprotocols.jar"

      [b]-Xms50m -Xmx256m[/b]

      "-Dws.ext.dirs=C:\Program Files\IBM\WebSphere\AppServer/java/lib;C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile/classes;C:\Program Files\IBM\WebSphere\AppServer/classes;C:\Program Files\IBM\WebSphere\AppServer/lib;C:\Program Files\IBM\WebSphere\AppServer/installedChannels;C:\Program Files\IBM\WebSphere\AppServer/lib/ext;C:\Program Files\IBM\WebSphere\AppServer/web/help;C:\Program Files\IBM\WebSphere\AppServer/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime"

      "-Dcom.ibm.itp.location=C:\Program Files\IBM\WebSphere\AppServer/bin"
      -Djava.util.logging.configureByServer=true
      -Dibm.websphere.preload.classes=true"
      -Duser.install.root=C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile"
      "-Dwas.install.root=C:\Program Files\IBM\WebSphere\AppServer"
      -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager "
      -Ddb2j.system.home=C:\Program Files\IBM\WebSphere\AppServer/cloudscape"
      "-Dserver.root=C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile"
      "-Djava.security.auth.login.config=C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile/properties/wsjaas.conf"
      "-Djava.security.policy=C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile/properties/server.policy"
      com.ibm.ws.bootstrap.WSLauncher com.ibm.ws.runtime.WsServer
      "C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile\config"
      CSGRADPC58Node02Cell CSGRADPC58Node02 server1[/i]

      Second, I gave 16 and 64 values as init and max respectively:

      (16,64)-> 144,624K (Process Expl-working set), 144,636K (task man):

      [i]
      "C:\Program Files\IBM\WebSphere\AppServer/java/bin/java"
      "-Xbootclasspath/p:C:\Program Files\IBM\WebSphere\AppServer/java/jre/lib/ext/ibmorb.jar;C:\Program Files\IBM\WebSphere\AppServer/java/jre/lib/ext/ibmext.jar"

      -Dwas.status.socket=1846

      -classpath "C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile/properties;C:\Program Files\IBM\WebSphere\AppServer/properties;C:\Program Files\IBM\WebSphere\AppServer/lib/bootstrap.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/j2ee.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/lmproxy.jar;C:\Program Files\IBM\WebSphere\AppServer/lib/urlprotocols.jar"

      [b]-Xms16m -Xmx64m[/b]

      "-Dws.ext.dirs=C:\Program Files\IBM\WebSphere\AppServer/java/lib;C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile/classes;C:\Program Files\IBM\WebSphere\AppServer/classes;C:\Program Files\IBM\WebSphere\AppServer/lib;C:\Program Files\IBM\WebSphere\AppServer/installedChannels;C:\Program Files\IBM\WebSphere\AppServer/lib/ext;C:\Program Files\IBM\WebSphere\AppServer/web/help;C:\Program Files\IBM\WebSphere\AppServer/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime"

      "-Dcom.ibm.itp.location=C:\Program Files\IBM\WebSphere\AppServer/bin"
      -Djava.util.logging.configureByServer=true
      -Dibm.websphere.preload.classes=true "
      -Duser.install.root=C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile"
      "-Dwas.install.root=C:\Program Files\IBM\WebSphere\AppServer"
      -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager
      "-Ddb2j.system.home=C:\Program Files\IBM\WebSphere\AppServer/cloudscape"
      "-Dserver.root=C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile"
      "-Djava.security.auth.login.config=C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile/properties/wsjaas.conf"
      "-Djava.security.policy=C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile/properties/server.policy"

      com.ibm.ws.bootstrap.WSLauncher
      com.ibm.ws.runtime.WsServer

      "C:\Program Files\IBM\WebSphere\AppServer/profiles/CS848Profile\config"
      CSGRADPC58Node02Cell CSGRADPC58Node02 server1[/i]

      As it is seen -Xms and -Xmx values are supplied properly, but somehow jvm does not take these values into account. I'm really confused after I've seen this result. I guess the problem is IBM JVM not the WebSphere!!!

      But as far as I know WS can only be run by IBM Java, so I don't have any choice to switch other JVMs. BTW, v6.0 uses IBM Java 1.4.2 I guess.

      Do you have any opinion upon this result?
      • SystemAdmin
        SystemAdmin
        37422 Posts
        ACCEPTED ANSWER

        Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and Xms options

        ‏2005-07-07T17:32:26Z  in response to SystemAdmin
        As your tests show that Xms and Xmx are well specified as command line
        argument, but as Ken stated, Heap size is not Process size.

        You can find details about the IBM JVM implemtation in the IBM JVM
        Diagnostic Guide at
        http://www-128.ibm.com/developerworks/java/jdk/diagnosis/.

        And to see the acutal heap usage, you can activate verbose gc log (it's a
        check box somewhere in Process Definition > JVM). They are then found in
        native_stderr.

        • SystemAdmin
          SystemAdmin
          37422 Posts
          ACCEPTED ANSWER

          Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and Xms options

          ‏2005-07-07T20:14:29Z  in response to SystemAdmin
          > As your tests show that Xms and Xmx are well
          > specified as command line
          > argument, but as Ken stated, Heap size is not Process
          > size.
          >
          > You can find details about the IBM JVM implemtation
          > in the IBM JVM
          > Diagnostic Guide at
          > http://www-128.ibm.com/developerworks/java/jdk/diagnos
          > is/.
          >
          > And to see the acutal heap usage, you can activate
          > verbose gc log (it's a
          > check box somewhere in Process Definition > JVM).
          > They are then found in
          > native_stderr.
          >

          Thanks for the reply.

          Again I did what you said, I ran the server process in verbose mode. You are right, as I read through the "native_stderr.log" I saw that the actual usage is really limited to Xmx value. For example,

          (Xms:100, Xmx:100) : (the last paragragh in the file)

          ...
          [i]<AF[9]: Allocation Failure. need 1216 bytes, 844 ms since last AF>
          <AF[9]: managing allocation failure, action=1 (568/101710336) (2945984/3145728)>
          <GC(9): GC cycle started Thu Jul 07 15:30:06 2005
          <GC(9): freed 56700800 bytes, [b]56% free (59647352/104856064)[/b], in 104 ms>
          <GC(9): mark: 75 ms, sweep: 29 ms, compact: 0 ms>
          <GC(9): refs: soft 0 (age >= 32), weak 0, final 0, phantom 0>
          <AF[9]: completed in 169 ms>
          <GC[0]: Expanded System Heap by 65536 bytes
          <GC[0]: Expanded System Heap by 65536 bytes[/i]

          Even I couldn't understand the whole idea of these lines (e.g. last two lines, I don't have any idea what they mean), from the bolded statement it's obvious that heap size is almost 100MB and %56 of the allocated memory is free. But still the working set of the process is read around 150MB both in process expl and task manager.

          As the last point I want to ask,

          1) What is the reason for the gap between process size and heap size?

          2) Shall I depend on task manager or IBM JVM? That is, while heap size seems to obey Xmx value, the process size considerably defers from this amount.

          What is the [b]actual[/b] amount the server process occupies? Does it hold a space of "process size" or "Xmx (heap) size"?

          Regards,
          • SystemAdmin
            SystemAdmin
            37422 Posts
            ACCEPTED ANSWER

            Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and Xms options

            ‏2005-07-08T01:24:08Z  in response to SystemAdmin
            oozmen@uwaterloo.ca wrote:

            >>As your tests show that Xms and Xmx are well
            >>specified as command line
            >>argument, but as Ken stated, Heap size is not Process
            >>size.
            >>
            >>You can find details about the IBM JVM implemtation
            >>in the IBM JVM
            >>Diagnostic Guide at
            >>http://www-128.ibm.com/developerworks/java/jdk/diagnos
            >>is/.
            >>
            >>And to see the acutal heap usage, you can activate
            >>verbose gc log (it's a
            >>check box somewhere in Process Definition > JVM).
            >>They are then found in
            >>native_stderr.
            >>
            >>
            >>
            >
            >Thanks for the reply.
            >
            >Again I did what you said, I ran the server process in verbose mode. You are right, as I read through the "native_stderr.log" I saw that the actual usage is really limited to Xmx value. For example,
            >
            >(Xms:100, Xmx:100) : (the last paragragh in the file)
            >
            >..
            >[i]<AF[9]: Allocation Failure. need 1216 bytes, 844 ms since last AF>
            ><AF[9]: managing allocation failure, action=1 (568/101710336) (2945984/3145728)>
            ><GC(9): GC cycle started Thu Jul 07 15:30:06 2005
            ><GC(9): freed 56700800 bytes, [b]56% free (59647352/104856064)[/b], in 104 ms>
            > <GC(9): mark: 75 ms, sweep: 29 ms, compact: 0 ms>
            > <GC(9): refs: soft 0 (age >= 32), weak 0, final 0, phantom 0>
            ><AF[9]: completed in 169 ms>
            ><GC[0]: Expanded System Heap by 65536 bytes
            ><GC[0]: Expanded System Heap by 65536 bytes[/i]
            >
            >Even I couldn't understand the whole idea of these lines (e.g. last two lines, I don't have any idea what they mean), from the bolded statement it's obvious that heap size is almost 100MB and %56 of the allocated memory is free. But still the working set of the process is read around 150MB both in process expl and task manager.
            >
            >As the last point I want to ask,
            >
            >1) What is the reason for the gap between process size and heap size?
            >
            >
            You'll need to study what a program actually is, and how a process
            actually runs. For starters, a process is code AND memory.

            >2) Shall I depend on task manager or IBM JVM? That is, while heap size seems to obey Xmx value, the process size considerably defers from this amount.
            >
            >What is the [b]actual[/b] amount the server process occupies? Does it hold a space of "process size" or "Xmx (heap) size"?
            >
            >
            Process size.

            >Regards,
            >
            >
          • SystemAdmin
            SystemAdmin
            37422 Posts
            ACCEPTED ANSWER

            Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and Xms options

            ‏2005-07-08T05:39:55Z  in response to SystemAdmin
            > 1) What is the reason for the gap between process size and heap size?
            Because the process size = java heap + JVM stuff + memory allocated by
            native code.
            If you need a more accurate description, I found the JVM Diagnostic Guide
            had a very good chapter about GC and heap allocation.

            > 2) Shall I depend on task manager or IBM JVM? That is, while heap size
            seems to obey Xmx value, the process size considerably defers from this
            amount.
            My experience is that I use to see process size is roughly 1.5 times larger
            than the heap.

            >
            > What is the [b]actual[/b] amount the server process occupies? Does it hold
            a space of "process size" or "Xmx (heap) size"?
            You must take that the server process size you don't want to exceed and
            define a heap 1.5 times smaller than that. It's what I do to get a basis,
            but you need to validate this for you own.

  • SystemAdmin
    SystemAdmin
    37422 Posts
    ACCEPTED ANSWER

    Re: Tuning WebSphere Server Process Memory (Heap Size) thru Xmx and Xms options

    ‏2006-05-31T12:29:17Z  in response to SystemAdmin
    > Third, I add -Xmx and -Xms values (e.g. -Xms16M
    > -Xmx64M) into startServer.bat file under
    > ..\AppServer\bin
    >
    > "%JAVA_HOME%\bin\java" %WAS_TRACE% %WAS_DEBUG%
    > %CONSOLE_ENCODING% "%CLIENTSAS%" "-classpath"
    > "%WAS_CLASSPATH%" "-Dws.ext.dirs=%WAS_EXT_DIRS%"
    > "-Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLo
    > gManager"
    > "-Djava.util.logging.configureByServer=true"
    > %USER_INSTALL_PROP% "-Dwas.install.root=%WAS_HOME%"
    > "-Dibm.websphere.preload.classes=true" [b]-Xms16m
    > -Xmx64m[/b] "com.ibm.ws.bootstrap.WSLauncher"
    > "com.ibm.ws.management.tools.WsServerLauncher"
    > "%CONFIG_ROOT%" "%WAS_CELL%" "%WAS_NODE%" %*
    >
    > But it didn't work either.

    I think I got a answer. If you check the task manager, you'll discover that this WsServerLauncher starts a new java.exe of the WAS. So the parameters of the JVM you had set belong to WsServerLauncher, not to WAS.