问题描述
我有一个应用程序在我的本地主机上运行,我想分析该应用程序以了解如何提高应用程序的性能.我正在按照定义执行设置步骤,但无法连接到本地主机服务器,是否有关于如何操作的正确分步指南:
I have an application running on my localhost and I want to profile the application to see how can I enhance the performance of the application. I am doing the setup steps as defined but it is not able to connect to localhost server, is there a proper step by step guideline available on how to:
- 配置 JProfiler 以使用在本地主机上运行的应用程序?
- 在分析应用程序时如何分析以及寻找哪些方面?
- 使用 Eclipse IDE 配置 JProfiler,现在可以在 Eclipse 的运行下拉列表中看到配置文件,但它们没有被激活,那么如何激活它?
我有与此问题类似的问题,但我无法理解解决方案,对此的任何建议将不胜感激.
I have similar issue as in this question but am not able to understand the solution, any suggestions on this would be really appreciated.
我已经尝试了一段时间,但没有成功配置 JProfiler 以与在本地主机上运行的应用程序一起工作,任何建议将不胜感激.
I am tried for sometime now without any success on configuring JProfiler to work with application running on localhost, any suggestions would be highly appreciated.
我是分析应用程序世界的新手,如果您能提供一些有用的指针,我将不胜感激
I am new to profiling application world and so would really appreciate if you can provide some useful pointers
我收到以下错误消息:
无法连接到 127.0.0.1:8849.请确保远程地址正确,远程程序正常启动,网络路由允许套接字连接.
我已经使用新服务器集成设置了配置,不确定还需要做什么以及如何做可以解决这个问题吗?
Could not connect to 127.0.0.1:8849. Please make sure that the remote address is correct, the remote program is started properly, and the network route allows socket connections.
and I have set up configuration using New Server Integration, not sure what else needs to be done and how can this be fixed.
添加-agentpath:C:Usersuser~1.DOSSOFTWA~1JPROFI~1inWINDOW~1jprofilerti.dll=port=8849,nowait,id=117后,config=C:Usersuser.jprofiler6config.xml
到 vm arguments
在运行配置下,然后当我运行配置时我得到
After adding -agentpath:C:Usersuser~1.DOSSOFTWA~1JPROFI~1inWINDOW~1jprofilerti.dll=port=8849,nowait,id=117,config=C:Usersuser.jprofiler6config.xml
to vm arguments
under run configuration and then when i run configuration i get
JProfiler> Protocol version 32
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:Usersuser.jprofiler6config.xml (id: 117)
JProfiler> Could not find session with id: 117`
推荐答案
在使用 JProfiler 进行分析时,不建议手动将 VM 参数添加到 eclipse 中的运行配置.
Manually adding a VM parameter to a run configuration in eclipse is not recommended for profiling with JProfiler.
有关 Eclipse IDE 集成的更多信息,请参阅 此截屏 和 此帮助页面.然后,您可以使用 Eclipse 运行配置来分析 JBoss,而无需添加任何 VM 参数.
For more on the eclipse IDE integration, see this screen cast and this help page. You can then profile JBoss with an eclipse run configuration without adding any VM parameters.
还有其他无需手动添加任何 VM 参数即可进行配置的方法:
There are other ways to profile without manually adding any VM parameters:
最简单的入门方法是使用 JProfiler 中的快速附加"功能.通过Session->Quick Attach",您可以获得正在运行的 JVM 列表,您可以对其进行配置,而无需添加任何 JVM 参数.
The easiest way to get started is to use the "Quick attach" feature in JProfiler. With "Session->Quick Attach" you get a list of running JVMs that you can profile without having to add any JVM parameters.
如果您在上述步骤中错过了到 eclipse 的源代码导航,如果安装了 JProfiler 插件,同样的操作在 eclipse 中可用.
If you miss source code navigation to eclipse in the above step, the same action is available in eclipse if the JProfiler plugin is installed.
- 对于独立配置,通过从 JProfiler 的主菜单调用Session->Integration Wizards->New Server Integration"来使用集成向导.集成向导将修改启动脚本,这样您就不必添加任何 VM 参数.
对于您收到的错误消息,我怀疑 C:Usersuser.jprofiler6config.xml
不存在.将参数减少到 -agentpath:C:Usersuser~1.DOSSOFTWA~1JPROFI~1inWINDOW~1jprofilerti.dll=port=8849
就可以了,然后JBoss VM 将等待,直到您从 JProfiler 使用附加到 JVM(本地或远程)"类型的会话进行连接.无论如何,只有在特殊情况下才需要手动添加VM参数.
For the error message that you got, I suspect that C:Usersuser.jprofiler6config.xml
does not exist. Reducing the parameter to -agentpath:C:Usersuser~1.DOSSOFTWA~1JPROFI~1inWINDOW~1jprofilerti.dll=port=8849
will work, then the JBoss VM will wait until you connect with a session of type "Attach to JVM (local or remote)" from JProfiler. Anyway, adding VM parameters manually is only necessary in special situations.
这篇关于如何将 JProfiler 连接到在本地主机上运行的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!