5

我无法使用 Netbeans 6.5 分析器远程分析 Java Web 应用程序的内存使用情况。

我已按照教程中的步骤进行操作,并且能够自定义 Tomcat 实例以从分析代理开始。我还可以将 Netbeans 分析器附加到正在运行的服务器:在几秒钟内,分析器会显示服务器内存使用情况的图表。

但是,我无法运行已部署的 Web 应用程序。几秒钟后,服务器会优雅地关闭,就好像它只是到达了 main 方法的底部(几乎不是 web 服务器的预期行为)。

在这几秒钟内,服务器不负责,我无法连接到其中的 Web 应用程序,它们根本没有部署。

我不想将我的应用程序导入到新的 Netbeans 项目中,只是为了对其进行分析。可以在不访问其源代码的情况下分析远程应用程序,对吗?毕竟,在几秒钟内,服务器正在运行并被分析。

我想在 Netbeans 6.5 中分析 Web 应用程序。我忘记了什么?

4

3 回答 3

1

您也可以使用 VisualVM 工具。请按照以下提到的步骤操作。

1)运行jstatd(jstat恶魔进程)(在运行应用程序的远程机器上运行)jstatd -p 1098 -J-Djava.security.policy=tools.policy(指定未使用的端口)如果未指定tools.policy文件创建它如下。

tools.policy 
grant codebase "file:${java.home}/../lib/tools.jar" {

权限 java.security.AllPermission; };

2) 在启动 JVM 之前还要指定以下属性。

#JMX property
JVM_ARGS="${JVM_ARGS} -Dcom.sun.management.jmxremote=true"
JVM_ARGS="${JVM_ARGS} -Dcom.sun.management.jmxremote.port=10992"
JVM_ARGS="${JVM_ARGS} -Dcom.sun.management.jmxremote.authenticate=false"
JVM_ARGS="${JVM_ARGS} -Dcom.sun.management.jmxremote.ssl=false"

3) 在本地机器上启动可视虚拟机。一个。在远程选项卡下添加远程节点。湾。等待几分钟,您将在远程选项卡下看到所有核心应用程序实例。C。单击远程节点,然后选择添加 JMX 连接,指定节点:端口(上面第 2 点中提到的端口)。等待几秒钟,您将在远程节点下看到 JMX 连接。

4) 几秒钟后,您将看到新选项卡出现在远程节点下。双击 remote_node:10992 您将在右侧看到配置文件表。您可以查看内存、cpu、线程等详细信息。

于 2011-02-07T11:04:11.013 回答
0

是分析整个网络服务器还是使用分析过滤器只分析你的包?减少profiler和app server本身的交互就可以解决。

于 2009-11-03T12:28:30.747 回答
0

Check your jvm version. The version used by netbeans should be same as that in tomcat. Use default ports. If you have changed any ports ensure they are above 1024. Try to profile the example application in tomcat (remove all other applications). If it is running sucessfully it means there is a memory constraint. Profiling requires huge memory. use -xms1024m -xmx1024m for tomcat. If every thing else fail. think of switching to jdk6 and tomcat 6. After many trials I discoverd that there are lot of limitations in jdk5 and tomcat5. switching to tomcat6 and jdk6 solved the problem for me.

Profiling with netbeans does not work jrockit, ibm jdk etc..

--kiran.kumar

于 2011-02-23T05:16:20.883 回答