首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将JProfiler会话与设计的ID连接起来?

如何将JProfiler会话与设计的ID连接起来?
EN

Stack Overflow用户
提问于 2014-05-12 09:22:13
回答 1查看 732关注 0票数 0

我用args启动了一个Java应用程序:

代码语言:javascript
复制
"-agentpath:C:\Program Files\jprofiler7\bin\windows-x64\jprofilerti.dll=port=8849,id=134,nowait"

然后控制台显示:

代码语言:javascript
复制
JProfiler> Protocol version 37
JProfiler> Using JVMTI
JProfiler> JVMTI version 1.1 detected.
JProfiler> 64-bit library
JProfiler> Don't wait for frontend to connect.
JProfiler> Using config file C:\Users\user\.jprofiler7\config.xml (id: 134)
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> Using dynamic instrumentation
JProfiler> Time measurement: elapsed time
JProfiler> CPU profiling enabled
JProfiler> Hotspot compiler enabled

那么我现在可以通过JProfiler图形用户界面连接了。

,但我需要通过另一个JProfiler应用程序将它与JProfiler API连接起来。,我怎么能把它连接起来呢?通过VM参数吗?

我只知道我可能必须先创建一个连接,但我不知道如何选择会话ID。

代码语言:javascript
复制
Connection connection = ConnectionFactory.createRemoteConnection("localhost", 8849, 30);

如果我运行代理应用程序,然后首先通过JProfiler GUi连接,我就可以通过GUi应用程序获取JProfiler信息,包括运行Java应用程序。

代码语言:javascript
复制
Profiling data :
Hot spots:
Top 5 hot spots:
Hot spot 1: ProfilerTest.main(java.lang.String[ ]): 34 ms (100 %)
Backtraces: 
ProfilerTest.main(java.lang.String[ ]): 34722 (0)
   ***: 34722 (0)
Cpu tree:
***: 34722 (0)
   ProfilerTest.main(java.lang.String[ ]): 34722 (0)
      java.util.Scanner.next(): 34722 (0)

但是,如果我运行代理应用程序,然后首先通过我的JProfiler API应用程序进行连接,我将一无所获。

代码语言:javascript
复制
Profiling data :
Hot spots:
Top 5 hot spots:
Cpu tree:
***: 0 (0)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-13 11:22:56

在",nowait“之后添加",config=path到配置文件,id=nnn”,其中“到配置文件的路径”是%USERPROFILE%.jprofiler8\config.xml,"nnn“是会话ID,它在会话设置对话框的应用程序设置选项卡的右上角可见。

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

https://stackoverflow.com/questions/23605294

复制
相关文章

相似问题

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