【发布时间】:2015-05-18 22:39:17
【问题描述】:
我正在尝试按如下方式分析 JBoss:
- 将
-agentpath:C:\Progra~1\jprofiler8\bin\windows-x64\jprofilerti.dll添加到standalone.bat。请注意,nowait未指定,因此 VM 将等待 JProfiler GUI 连接。 - 运行
standalone.bat - 使用“运行 -> 附加到 JVM”从 IDEA 附加
问题是无论我做什么,“快速附加”窗口都看不到 JBoss JVM。
这是显示 JProfiler 准备就绪的 JBoss 标准输出:
Calling "C:\src\ss-master\middle\runtime\jboss-as-7.1.1.Final\bin\standalone.conf.bat"
===============================================================================
JBoss Bootstrap Environment
JBOSS_HOME: C:\src\ss-master\middle\runtime\jboss-as-7.1.1.Final
JAVA: C:\tools\java\bin\java
JAVA_OPTS: -XX:+TieredCompilation -agentpath:C:\Progra~1\jprofiler8\bin\windows-x64\jprofilerti.dll -Dprogram.name=standalone_jprofiler.bat -Xms256m -Xmx8192m -XX:NewRatio=6 -XX:
PermSize=128m -XX:MaxPermSize=256m -Xss512K -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.war
ning=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djboss.server.default.config=standalone.xml -Dorg.jboss.server.bootstrap.maxThreads=8 -agentlib:jdwp=transport=dt_socket,se
rver=y,suspend=n,address=5001
===============================================================================
JProfiler> Protocol version 41
JProfiler> Using JVMTI
JProfiler> JVMTI version 1.1 detected.
JProfiler> 64-bit library
JProfiler> Listening on port: 8849.
JProfiler> Instrumenting native methods.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Native library initialized
JProfiler> VM initialized
JProfiler> Waiting for a connection from the JProfiler GUI ...
以下是我尝试过的一些事情:
- JProfiler UI 中的“快速附加”也看不到 JBoss VM。
- 在启动选项中使用
nowait,连接成功(即使来自IDEA)。 - 没有
nowait,我只能从JProfiler GUI 中的预定义会话进行连接。之后,我也可以从 IDEA 连接。
最后一点是最有趣的。保存的会话有哪些额外信息可以使它检测到“等待”的 JProfiler 代理?
以下是我的用例的限制:
- 我想从 IDEA 启动分析,以便跳转到源代码将我带到 IDEA。
- 我想分析启动阶段,所以无法添加
nowait。
【问题讨论】:
标签: jprofiler