远程分析 Java 应用程序

编程入门 行业动态 更新时间:2024-10-10 11:20:44
本文介绍了远程分析 Java 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想问一下如何远程分析 Java 应用程序.对于调试,我可以说 JVM 必须侦听哪个端口等,因为我尝试访问的机器在 ssh 网关后面,所以我手动创建了一个 SSH 隧道,但我一直在搜索同样的事情,但是在分析时我不能'好像没找到基本上我正在寻找与此命令等效的命令:

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.

推荐答案

免责声明:我公司开发JProfiler

Disclaimer: My company develops JProfiler

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

With JProfiler, the VM parameter is like this:

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

"/path/to/libjprofilerti.so" 是本地代理库的路径,在 Linux x86 上,对于 32 位 JVM,它将是 [JProfiler 安装目录]/bin/linux-x86/libjprofilerti.so.使用 port 参数,您可以告诉代理侦听特定端口.您可以将其设置为 SSH 隧道的端口.

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

您可以通过调用 JProfiler 主菜单中的 Session->Integration Wizards->New Remote Integration 轻松生成此 VM 参数:

You can easily generate this VM parameter by invoking Session->Integration Wizards->New Remote Integration in JProfiler's main menu:

在您的本地机器上,您创建一个类型为Attach to profiled JVM"的新会话并选择您的 SSH 隧道的本地端口(屏幕截图中的 10022):

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

更多推荐

远程分析 Java 应用程序

本文发布于:2023-11-25 06:02:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628607.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   Java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!