远程分析 Java 应用程序
我想问一下如何远程分析 java 应用程序。为了调试,我可以说 JVM 必须侦听哪个端口等,因为我尝试访问的机器位于 ssh 网关后面,所以我手动创建一个 SSH 隧道,但我一直在谷歌上搜索同样的事情,但在分析时我不能'似乎没有找到。基本上我正在寻找与此命令等效的命令:
java -agentlib:jdwp=transport=dt_socket,server=y,address=8000 -jar /bla/bla
但用于分析,以便我可以远程附加分析器。
I'd like to ask how I can profile REMOTELY a java application. For debugging I can say which port the JVM must listen etc since the machine I'm trying to access is behind an ssh gateway so I manually create an SSH tunnel but I've been googling about the same thing but when profiling and I couldn't seem to find. Basically I'm looking for the equivalent of this command:
java -agentlib:jdwp=transport=dt_socket,server=y,address=8000 -jar /bla/bla
but for profiling so that I can remotely attach a profiler.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
免责声明:我公司开发的JProfiler
使用JProfiler,VM参数是这样的:
“/path/to/libjprofilerti.so”是本机代理库的路径,在 Linux x86 上,对于 32 位 JVM,它将是 [JProfiler 安装目录]/bin/linux-x86/libjprofilerti.so。使用端口参数,您可以告诉代理侦听特定端口。您可以将其设置为 SSH 隧道的端口。
您可以通过调用 JProfiler 主菜单中的 Session->Integration Wizards->New Remote Integration 轻松生成此 VM 参数:
本地计算机上,创建一个“附加到分析的 JVM”类型的新会话,并选择 SSH 隧道的本地端口(屏幕截图中的 10022):
Disclaimer: My company develops JProfiler
With JProfiler, the VM parameter is like this:
"/path/to/libjprofilerti.so" is the path to the native agent library, on Linux x86, for a 32-bit JVM it would be [JProfiler installation directory]/bin/linux-x86/libjprofilerti.so. With the port parameter, you can tell the agent to listen on a specific port. You can set this to the port of your SSH tunnel.
You can easily generate this VM parameter by invoking Session->Integration Wizards->New Remote Integration in JProfiler's main menu:
On your local machine, you create a new session of type "Attach to profiled JVM" and choose the local port of your SSH tunnel (10022 in the screen shot):