如何生成javacore和heapdump


-----成功生成:
如何生成javacore和heapdump
进入wsadmin
  D:\IBM\WebSphere\AppServer\bin>wsadmin -user wasadmin -password password
生成javacore
设置jvm环境变量:
  wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=server1,*]
生成javacore文件:
  wsadmin>$AdminControl invoke $jvm dumpThreads
生成heapdump
找到JVM对象名字:
  wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=server1,*]
生成heapdump文件:
  wsadmin>$AdminControl invoke $objectName generateHeapDump

 

 

生成javacore和heapdump例子:
D:\IBM\AppServer\profiles\AppSrv01\bin>wsadmin.bat
  WASX7209I: 使用 SOAP 连接器连接到节点 javavagNode01 上的进程“server1”;进程的
 类型为:UnManagedProcess
 WASX7029I: 要获取帮助,请输入:“$Help help”
wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=server1,*]
   WebSphere:name=JVM,process=server1,platform=proxy,node=javavagNode01,j2eeType=JV
   M,J2EEServer=server1,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,
   cell=javavagN   ode01Cell,spec=1.0

wsadmin>$AdminControl invoke $jvm dumpThreads
   生成的javacore位置为:
   D:\IBM\AppServer\profiles\AppSrv01\javacore.20090410.153958.3564.txt


wsadmin>$AdminControl invoke $objectName generateHeapDump

 

生成javacore和heapdump例子:
D:\IBM\AppServer\profiles\AppSrv01\bin>wsadmin.bat
  WASX7209I: 使用 SOAP 连接器连接到节点 javavagNode01 上的进程“server1”;进程的
 类型为:UnManagedProcess
 WASX7029I: 要获取帮助,请输入:“$Help help”
wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=server1,*]
   WebSphere:name=JVM,process=server1,platform=proxy,node=javavagNode01,j2eeType=JV
   M,J2EEServer=server1,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,
   cell=javavagN   ode01Cell,spec=1.0

wsadmin>$AdminControl invoke $jvm dumpThreads
   生成的javacore位置为:
   D:\IBM\AppServer\profiles\AppSrv01\javacore.20090410.153958.3564.txt

wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=server1,*]
    WebSphere:name=JVM,process=server1,platform=proxy,node=javavagNode01,j2eeType=JVM,
    J2EEServer=server1,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=javavagNode01Cell,spec=1.0
wsadmin>$AdminControl invoke $objectName generateHeapDump
wsadmin>
生成的Heapdump文件位置为:
D:\IBM\AppServer\profiles\AppSrv01\heapdump.20090410.154059.3564.phd


set jvm [$AdminControl completeObjectName type=JVM,process=ncMem01,*]
$AdminControl invoke $jvm dumpThreads
set objectName [$AdminControl queryNames WebSphere:type=JVM,process=ncMem01,*]
$AdminControl invoke $objectName generateHeapDump


set jvm [$AdminControl completeObjectName type=JVM,process=master,*]
$AdminControl invoke $jvm dumpThreads
set objectName [$AdminControl queryNames WebSphere:type=JVM,process=master,*]
$AdminControl invoke $objectName generateHeapDump

 

set jvm [$AdminControl completeObjectName type=JVM,process=ncMem02,*]
$AdminControl invoke $jvm dumpThreads
set objectName [$AdminControl queryNames WebSphere:type=JVM,process=ncMem02,*]
$AdminControl invoke $objectName generateHeapDump


set jvm [$AdminControl completeObjectName type=JVM,process=ncMem03,*]
$AdminControl invoke $jvm dumpThreads
set objectName [$AdminControl queryNames WebSphere:type=JVM,process=ncMem03,*]
$AdminControl invoke $objectName generateHeapDump


was内存监控
查看内存使用情况方法:
sysMonitor.bat 设置端口号,然后进行查看内存使用状态。

如何生成javacore和heapdump
进入wsadmin
  D:\IBM\WebSphere\AppServer\bin>wsadmin -user was -password ytoadmin@2011
生成javacore
设置jvm环境变量:
  wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=server1,*]
生成javacore文件:
  wsadmin>$AdminControl invoke $jvm dumpThreads
生成heapdump
找到JVM对象名字:
  wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=ncMem01,*]
生成heapdump文件:
  wsadmin>$AdminControl invoke $objectName generateHeapDump

 

 

 

 


如果启用了安全,则需要输入用户名和密码:

 


[root@hrapp bin]# pwd
/opt/IBM/WebSphere/AppServer/bin
[root@hrapp bin]# ./set jvm [$AdminControl completeObjectName type=JVM,process=ncMem01,*]
-bash: ./set: 没有那个文件或目录
[root@hrapp bin]# ./wsadmin.sh
WASX7246E: 因为认证失败无法建立到主机“localhost”的“SOAP”连接。确保命令行上或属性文件中的用户和密码是正确的。
异常消息(如有):“ADMN0022E: 由于凭证不足或凭证为空,无法对 Server MBean 的 getProcessType 操作进行访问。”
WASX7213I: 此脚本编制客户机未连接到服务器进程;请参阅日志文件 /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/wsadmin.traceout 以获取更多信息。
WASX8011W: AdminTask 对象不可用。
[root@hrapp bin]# ./wsadmin.sh   -user   admin    -password     ytoadmin@2011
WASX7209I: 使用 SOAP 连接器连接到节点 hrappCellManager01 上的进程“dmgr”;进程的类型为:DeploymentManager
WASX7029I: 要获取帮助,请输入:“$Help help”
wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=ncMem01,*]
WebSphere:name=JVM,process=ncMem01,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=ncMem01,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $jvm dumpThreads

wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=ncMem01,*]
WebSphere:name=JVM,process=ncMem01,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=ncMem01,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $objectName generateHeapDump
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/./heapdump.20110408.015156.31480.phd
wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=master,*]
WebSphere:name=JVM,process=master,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=master,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $jvm dumpThreads

wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=master,*]
WebSphere:name=JVM,process=master,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=master,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $objectName generateHeapDump
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/./heapdump.20110408.015504.31213.phd
wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=ncMem02,*]
WebSphere:name=JVM,process=ncMem02,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=ncMem02,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $jvm dumpThreads

wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=ncMem02,*]
WebSphere:name=JVM,process=ncMem02,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=ncMem02,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $objectName generateHeapDump
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/./heapdump.20110408.015625.31779.phd
wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=ncMem03,*]
WebSphere:name=JVM,process=ncMem03,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=ncMem03,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $jvm dumpThreads

wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=ncMem03,*]
WebSphere:name=JVM,process=ncMem03,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=ncMem03,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $objectName generateHeapDump
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/./heapdump.20110408.015728.32051.phd
wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=ncMem03,*]
WebSphere:name=JVM,process=ncMem03,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=ncMem03,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $jvm dumpThreads

wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=ncMem03,*]
WebSphere:name=JVM,process=ncMem03,platform=proxy,node=hrappNode01,j2eeType=JVM,J2EEServer=ncMem03,version=6.1.0.11,type=JVM,mbeanIdentifier=JVM,cell=hrappCell01,spec=1.0
wsadmin>$AdminControl invoke $objectName generateHeapDump
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/./heapdump.20110408.020032.32051.phd
wsadmin>invoke $objectName generateHeapDump
WASX7015E: 运行命令时发生异常:“invoke $objectName generateHeapDump”;异常信息:
com.ibm.bsf.BSFException: error while eval'ing Jacl expression:
invalid command name "invoke"
    while executing
"invoke $objectName generateHeapDump"
wsadmin>$AdminControl invoke $objectName generateHeapDump
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/./heapdump.20110408.020148.32051.phd
wsadmin>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值