WLST script for listing WebLogic Server memory usage

Peter Lorenzen
28/01-2014

Here is a short script for listing Java heap usage for all WebLogic Servers in a domain.

domainRuntime()

servers = domainRuntimeService.getServerRuntimes();
print('################################################################')
print('# Java heap information per server')
print('################################################################')
print('%20s %10s %8s %8s %4s' % ('Server','Current','Free','Max','Free'))
for server in servers:
   free    = int(server.getJVMRuntime().getHeapFreeCurrent())/(1024*1024)
   freePct = int(server.getJVMRuntime().getHeapFreePercent())
   current = int(server.getJVMRuntime().getHeapSizeCurrent())/(1024*1024)
   max     = int(server.getJVMRuntime().getHeapSizeMax())/(1024*1024)
   print('%20s %7d MB %5d MB %5d MB %3d%%' % (server.getName(),current,free,max,freePct))

disconnect()
exit()

Execute the memory.py script.

. /u01/app/oracle/product/wls103/wlserver_10.3/server/bin/setWLSEnv.sh
java weblogic.WLST -skipWLSModuleScanning
connect(username='weblogic',password='welcome1',url='t3://wintermute:7001')
execfile('memory.py')

Example:

################################################################
# Java heap information per server
################################################################
              Server    Current     Free      Max Free
         AdminServer     437 MB   101 MB  1344 MB  74%
         WLS_REPORTS     254 MB   142 MB   455 MB  75%
           WLS_FORMS     510 MB   333 MB   683 MB  74%
              VIP_ms     382 MB   125 MB   683 MB  62%
             a133_ms     700 MB   143 MB  1344 MB  58%
               SB_ms     383 MB   207 MB   683 MB  74%
          WSSTAKS_ms     382 MB   129 MB   683 MB  62%
              SSU_ms     510 MB   313 MB   910 MB  78%

 

{ 1 comment… read it below or add one }

Paul Ramos June 26, 2014 at 16:38

Awesome!!! Thank YOU!!!

Leave a Comment

Previous post:

Next post: