Вы находитесь на странице: 1из 1

Kevin McGrath There are a couple of things you can do.

One is trigger a heap d


ump on any JVM crash if you are not already getting one. The other is run some s
hort scripts every so often to print JVM memory usage. Try putting the following
lines (or something like them) in a file and running the file from the command
line like this:
wsadmin.sh -lang jython -f FILE_NAME.py
I would include lines like:
s = "the name of your WAS application server"
n = "the node that contains that server"
print AdminTask.showJVMProperties( ' [ -serverName ' + s + ' -nodeName ' + n + '
] ' )
print AdminTask.showJVMSystemProperties( ' [ -serverName ' + s + ' -nodeName ' +
n + ' ] ' )
print AdminTask.showProcessDefinition( ' [ -serverName ' + s + ' -nodeName ' + n
+ ' ] ' )
alive = AdminControl.queryNames("type=JVM,*").splitlines()
if len(alive ) > 0:
print "\nThere are",len(alive),a+("(s)"),"instantiated at this time"
print "Required attributes\n",AdminConfig.required('JavaVirtualMachine')
print "Optional and required attributes\n",AdminConfig.attributes('JavaVirtualMa
chine')
for x in alive:
print x
oName = AdminControl.makeObjectName(x)
print "- - - physical memory - - ->",AdminControl.getAttribute_jmx(oName,"maxMem
ory")
print "- - - current heap size - - ->",AdminControl.getAttribute_jmx(oName,"heap
Size")
print "- - - available on heap - - ->",AdminControl.getAttribute_jmx(oName,"free
Memory")
print "- - - Java version - - ->",AdminControl.getAttribute_jmx(oName,"javaVersi
on")
print "- - - Java vendor - - ->",AdminControl.getAttribute_jmx(oName,"javaVendor
")
print "- - - how many heap dumps allowed to disk - - ->",AdminControl.getAttribu
te_jmx(oName,"maxHeapDumpsOnDisk")
print "- - - available statistics - - ->",AdminControl.getAttribute_jmx(oName,"s
tats")

Вам также может понравиться