zoukankan      html  css  js  c++  java
  • 使用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

  • 相关阅读:
    cnblogs 博客园下载工具
    SQL 排序规则 CodeProject
    SQL 排序规则问题
    Datatbel和 string之间的相互转换
    C#三步实现标准事件处理程序
    利用C#来做ASP.NET的登陆页面
    C#用panel实现子窗体的切换
    C#中split分隔字符串的应用
    C#.NET 用程序画图,曲线图
    C#中消息的工作流程
  • 原文地址:https://www.cnblogs.com/lpthread/p/3510088.html
Copyright © 2011-2022 走看看