首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在第一次连接JProfiler JProfiler时跳过“等待来自JProfiler的连接”的信息

如何在第一次连接JProfiler JProfiler时跳过“等待来自JProfiler的连接”的信息
EN

Stack Overflow用户
提问于 2014-05-09 11:23:47
回答 1查看 2.5K关注 0票数 2

我想使用离线模式连接应用程序,并且我已经关闭了防火墙软件。

我会得到一些信息,比如:

代码语言:javascript
复制
C:\workspace\newperflog\TestThread\bin>java "-agentpath:C:\Program Files\jprofil
er7\bin\windows-x64\jprofilerti.dll=port=8849" ProfilerTest
JProfiler> Protocol version 37
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 ...

我无法用一条消息连接应用程序:

代码语言:javascript
复制
Exception in thread "main" java.lang.NullPointerException
    at com.jprofiler.core.comm.d.a.getThreadInfos(ejt:229)
    at TestProfiler.dumpProfilingData(TestProfiler.java:59)
    at TestProfiler.main(TestProfiler.java:46)

但是,如果我首先使用JProfiler GUI连接,那么我可以使用脱机命令连接它。

我在调用JProfiler图形用户界面时是否缺少任何论据?

通过Java连接后,我可以通过JProfiler离线应用程序获得以下信息:

代码语言:javascript
复制
JProfiler> Protocol version 37
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> Hotspot compiler enabled
JProfiler> Using sampling (5 ms)
JProfiler> Time measurement: elapsed time
JProfiler> CPU profiling enabled
JProfiler> Disconnected. Waiting for reconnection.
JProfiler> Listening on port: 8849.
JProfiler> Reconnection.
JProfiler> Disconnected. Waiting for reconnection.
JProfiler> Listening on port: 8849.
JProfiler> Reconnection.
JProfiler> Disconnected. Waiting for reconnection.
JProfiler> Listening on port: 8849.


Before Connected
Connected
Profiling data :
Hot spots:

Top 5 hot spots:
Hot spot 1: ProfilerTest.main(java.lang.String[ ]): 50 ms (100 %)
Backtraces: 
ProfilerTest.main(java.lang.String[ ]): 50045 (0)
   ***: 50045 (0)

Cpu tree:

***: 50045 (0)
   ProfilerTest.main(java.lang.String[ ]): 50045 (0)
      java.util.Scanner.next(): 50045 (0)

Custom payload hot spots:

Tested load factors:
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-09 20:00:26

只需将‘,nowait’添加到-agentpath命令中,然后跳过该消息。这不是“离线分析”,您可以稍后与JProfiler连接。

对于离线分析,可以添加,offline参数并引用包含触发器和操作的特殊配置,这样就不必连接JProfiler GUI。

分析API (在TestProfiler中使用)在这方面不相关。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23563372

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档