使用JProfiler分析定位java内存泄露memory leak

使用jprofiler远程profile JBoss应用服务器

项目中发现JBoss出现内存泄露, 从2G一直涨到3.5G左右

开始考虑使用jmap dump出内存来, 在用jhap打开浏览器分析。

想到JProfiler可以看类的引用关系, 更容易分析内存泄露, 所以决定使用JProfile。 同时应为JBoss运行在远端的服务器, 所以要使用remote attachment

 

1) 安装JProfiler. In Windows install jprofiler_windows-x64_8_0_2.exe; in Linux, install jprofiler_linux_8_0_2.rpm.

2) 修改JBoss的/opt/jboss/default/bin/standalone.conf

    add VM parameter: -agentpath:/opt/jprofiler8/bin/linux-x64/libjprofilerti.so=port=8849  // 需要Jprofile连接一下, java JVM才会启动。 

    也可以添加,nowait. 区别是, 加入这个参数后, 就不用jprofile连接一下了。

3) 启动JBoss

4) add ssh port forward using PuTTY

5) 在windows上启动JProfiler来远程连接Linux上的JBoss

    Open JProfiler client. -> Start center -> New session tab -> New session button -> select remote -> configure host and port of target jvm -> Start

    Start target JVM. it will pause and wait JProfiler to attach it.

    In JProfiler client, click Attach and OK

    When the evaluation ends, the client still can open but it doesn’t wor

 

转载于:https://www.cnblogs.com/lpthread/p/3510088.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值