4 Replies Latest reply on Jan 9, 2019 7:10 AM by Martien van den Akker

    Allocating mem per WLS managed server

    Patrice Boivin

      I followed tech note How to Customize Different Heap Sizes for Different Servers in a WebLogic Domain (Doc ID 1924617.1) but noticed that even after I specify smaller values, the processes in Task Manager are each gobbling up between 800M - 1.1G of memory


      I had tried

      @REM IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values


      if "%SERVER_NAME%"=="AdminServer" (

        set USER_MEM_ARGS="-Xms1024m -Xmx1024m"


      if "%SERVER_NAME%"=="WLS_REPORTS" (

        set USER_MEM_ARGS="-Xms128m -Xmx512m"


      if "%SERVER_NAME%"=="WLS_FORMS" (

        set USER_MEM_ARGS="-Xms128m -Xmx512m"



      if "%SERVER_NAME%"=="HelloWorld" (

        set USER_MEM_ARGS=-Xms128m -Xmx256m

          @REM 32 bit JVM memory settings

          set SERVER_MEM_ARGS_32=-Xms128m -Xmx256m

          set SERVER_MEM_ARGS_32HotSpot=-Xms128m -Xmx256m

          set SERVER_MEM_ARGS_32JRockit=-Xms128m -Xmx256m

          @REM 64 bit JVM memory settings

          set SERVER_MEM_ARGS_64=-Xms128m -Xmx256m

          set SERVER_MEM_ARGS_64HotSpot=-Xms128m -Xmx256m

          set SERVER_MEM_ARGS_64JRockit=-Xms128m -Xmx256m



      if NOT "%USER_MEM_ARGS%"=="" (

        set MEM_ARGS=%USER_MEM_ARGS%



      Not sure, but I don't think HotSpot or JRockIt are in use but I set them all to these small values.

      Once started though the managed server HelloWorld is using... 710964K of memory.  What a glutton.

      Since that didn't work I tried specifying -Xms128m -Xmx256m in that managed servers's startup parameters page in WLS Console, but it is using the same amount of memory as before, I just ignored the settings.


      Is it possible that the values set in setDomainEnv.cmd are overwritten later on when we use the WLS Console (and node manager) to start a managed server?

      or is it that on Windows x64 the JDK ignores the -Xms and -Xmx arguments and just does whatever it wants.

        • 1. Re: Allocating mem per WLS managed server

          What version of weblogic are you using? By default, if you use the startManagedWebLogic script, it will use the values defined in the setDomainEnv script, but if you use the node manager to start them, then it will use the values in the Startup settings instead, but that can be overwritten in the node manager config, but assuming you have not changed those.

          And btw, 800MB-1.1GB isn't a lot of memory these days and will be required if you load FMW applications into weblogic.

          • 2. Re: Allocating mem per WLS managed server
            Martien van den Akker



            If you use weblogic 12c, then it is adviced not to change the setDomainEnv.sh, but instead create a setUserOverrides.sh in the same folder and set user settings over there.

            Then indeed as handat says, there might be a difference when starting from nodemanager or using the start scripts. However, in the nodemanager.properties you can set properties to use the start and stop scripts (what I would recommend).


            But, it also depends on the java version. You did not set the -XX:MaxPermSize (Java 7 and prior) or -XX:MaxMetaspaceSize (Java 8 and above). So that adds to the OS process.

            But, not only that, Java VM itself also needs a bit of OS memory to work. For internal algorithms etc. So if you have a heap of max 256M and a Max PermGen/MetaSpace of 256M, you would conclude that the process size is 512M, But this could easily be 20% higher. So it would not suprise me you would see 800M.


            Also, Weblogic uses native libraries for IO. These are natively compiled C libararies that are also loaded into the native memory part of the JVM process.


            Then when not setting a maxMetaspaceSize (Java 8) there is no limitation. Java will managed this itself.


            But also, earlier this year we've seen with FusionMiddleWare including WebServicesManager the AdminServer would grow beyond the maxMetaspaceSize, due to excessive load of duplicate classes (this was a bug).


            Thus the story is a bit more complex then adding heap + metaspace/permgen size.



            • 3. Re: Allocating mem per WLS managed server
              Krishna vamsi



              Check the parameters of managed server defined in server start section from console and make appropriate changes to memory parameters there as well.




              • 4. Re: Allocating mem per WLS managed server
                Martien van den Akker

                Hi Patrice,


                Did you solve this already? If not, run JVisualVM or jmc from the java home on your system. Then open the particular jvm that runs your weblogic server.

                On the System properties tab (or similar) you can investigate the startup parameters of your JVM. Also on the memory tab you can see the current memory consumption.


                You could also investigate the server.log and/or the server.out file. There you can also investigate the classpath and memory settings. These are a result of the conditions in the startup scripts. Probably you changed settings in a part of your scripting that did not get touched because of the conditions.


                Do you use NodeManager to start your server? Or do you use the startup scripts?


                Also, can you show a screendump of the servers tab of the weblogic console?