远程分析 Java 应用程序

发布于 2024-12-06 15:34:57 字数 273 浏览 0 评论 0原文

我想问一下如何远程分析 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我家小可爱 2024-12-13 15:34:57

免责声明:我公司开发的JProfiler

使用JProfiler,VM参数是这样的:

-agentpath:/path/to/libjprofilerti.so=port=8849

“/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:

-agentpath:/path/to/libjprofilerti.so=port=8849

"/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:

enter image description here

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):

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文