7 Replies Latest reply: Dec 22, 2010 12:24 AM by 702994 RSS

    How to check  Memory Usage of Weblogic Server

    685580
      Hi


      Ours is a small company can;t afford licence for JProbe or any other commercial tool .
      Please tell me still is it possible to check the memory usage of the server increasing over time?

      Our J2EE application hangs in middle .
      Thanks in advance .

      Edited by: user672373773 on Dec 13, 2009 2:25 AM
        • 1. Re: How to check  Memory Usage of Weblogic Server
          Jay SenSharma MiddlewareMagic
          Hi,

          Option 1).
          You can use JMX code to Monitor the Heap Usages of your Application Server in the Runtime...as well as you can send some E-Mail alert codes also in it.

          Here is a Sample for it: (This Simple code can monitor Every thing you want Like JMS/JDBC/ThreadPoolStatistics/*JVM runtime Statistics*)

          http://jaysensharma.wordpress.com/2009/12/06/jdbc_jms_threadpool_jvm-monitoring/
          OR

          http://jaysensharma.wordpress.com/2010/04/08/remote-jvm-analysis-mini-jconsole/

          Option 2). You can use WLDF feature provided as part of WebLogic for Automatic Watch and Notifications.

          http://jaysensharma.wordpress.com/2010/01/07/e-mail-notification-using-wldf/

          Thanks
          Jay SenSharma
          http://jaysensharma.wordpress.com (WebLogic Cool Stuff)

          Edited by: Jay SenSharma on Jan 7, 2010 3:04 PM
          • 2. Re: How to check  Memory Usage of Weblogic Server
            Faisal Khan
            You will have to use ur own logic to implement it in WLST.. like loopinng, getting server names.. and performing some task in heap size is beyond certain threshold...

            you can get the heap size for one server in the followin way..

            domainRuntime()
            cd("/ServerRuntimes/AdminServer/JVMRuntime/AdminServer")
            heapSize = cmo.getHeapSizeCurrent()
            print heapSize
            • 3. Re: How to check  Memory Usage of Weblogic Server
              756051
              Hi,

              In addition to the above posts, I would like to add two more options:
              1. You can use JConsole(which is free), which will come along with Sun JDK and you can find this inside the jdk/bin .
              2. You can even try using the Administration console Monitoring tab for heap usage and threads usage information.

              Thanks,
              Sreedevi
              • 4. Re: How to check  Memory Usage of Weblogic Server
                user507243
                Hi Sreedevi

                I found the Jconsole under jdk/bin. Can you please tell me how to use that. Is it a GUI based console or just a command line monitoring tool.

                Thanks
                PC i
                • 5. Re: How to check  Memory Usage of Weblogic Server
                  759273
                  JConsole is GUI based and you may refer following links for more details:

                  http://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.html
                  http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html

                  Hope this helps.

                  Regards,
                  Anshul.
                  • 6. Re: How to check  Memory Usage of Weblogic Server
                    764409
                    What platform are you on?

                    If the server is linux/unix then you will need to do some X or sit at the console on the server(asuming running a X manager) and just
                    <path to jconsole>jconsole &

                    If windows server you can do the same sit at console, RDP, or I use Xming....(unix server) windows Terminal server....Xming will allow
                    you to login to unix/linux box and run jconsole....(remember to set your DISPLAY)

                    It works real nice...

                    You can also do Jconsole and connect to a remote server using IIOP/rmi.....but I haven't had much success getting that to
                    go...MBEAN browsing produces marshalling errors for size of tree...can see very little of the advertised MBEAN directory
                    • 7. Re: How to check  Memory Usage of Weblogic Server
                      702994
                      below are the simple steps to know the jvm usage of your managed server:

                      if your os is unix flavour ...

                      1)../setDomainEnv.sh

                      2) java weblogic.Admin -url hostip:port -username weblogic -password weblogic GET -pretty -type JVMRuntime

                      output should be something like below :

                      MBeanName: "mydomain:Location=myserver,Name=myserver,ServerRuntime=myserver,Type=JVMRuntime"
                      CachingDisabled: true
                      HeapFreeCurrent: 221438512
                      HeapSizeCurrent: 265879552
                      JavaVendor: Sun Microsystems Inc.
                      JavaVersion: 1.5.0_15
                      Name: myserver
                      OSName: Windows XP
                      OSVersion: 5.1
                      ObjectName: myserver
                      Parent: myserver
                      Registered: true
                      Type: JVMRuntime