我正在尝试在 Red Hat Linux 中使用 JVisualVM 监视远程 tomcat 进程。CPU 采样工作正常,但内存采样选项卡被禁用。它说“内存采样:不可用。不支持远程应用程序”。
进程的命令行参数:
-Djavac.source=1.5 -Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=11107
Run Code Online (Sandbox Code Playgroud)
JVisualVm 详细信息:
Version:
1.6.0_24 (Build 100930); platform 100909-1140d3a55456
System:
Linux (2.6.18-53.1.14.el5) , i386 32bit
Java:
1.6.0_24; Java HotSpot(TM) Client VM (19.1-b02, mixed mode)
Run Code Online (Sandbox Code Playgroud)
有什么我想念的吗?我对这一切都很陌生。
如何在VisualVM中更改应用程序名称?我有多个应用程序,从我的IDE开始,但很难区分它们,名称是相同的,唯一的区别是PID.所以我想给他们有意义的名字,但菜单项"重命名.."被禁用.如何重命名应用程序?在我看来,重命名只能在快照上进行 - > 快照的描述

我使用的是JRE1.7.0_25.不久之前,我运行了一个由webex会话强制执行的Java更新.似乎在更新之后,我不再能够使用jvisualvm检查正在运行的java进程(进程已启动 - 我已检查过).除非将JRE更改回以前的JRE7版本,否则我还能做些什么来解决/解决问题?jvisualvm中的应用程序选项卡仅显示visualvm和eclipse - 而不是任何其他java进程.谢谢.
更新:
重新启动后,我收到以下错误: 无法检测到本地Java应用程序.
http://visualvm.java.net/troubleshooting.html#jpswin
不幸的是,那里提到的解决方案似乎并不适用于我的情况.任何禁止重新安装JRE的建议都将受到赞赏.
更新:
JRE从1.7.0_25更新至1.7.0_45.我将在卸载JRE 1.7.0_45后更新.
请帮我.我在VisualVM中分析我的堆转储.
如何获得值=="0"的所有字符串的数量?我有以下查询:
select count(s) from java.lang.String s where s.toString().equals("0");
Run Code Online (Sandbox Code Playgroud)
但它不起作用.我想收到所有字符串的数量为"0"值,如果它们的大小可能在内存中.
当使用 VisualVm 的堆转储时,有一个选项可以查看特定类的所有实例,但是当实例太多时,我收到此错误:
\n\n堆 walker\xef\xbc\x9a\n 内存不足\n要避免此错误\xef\xbc\x8c,请增加 NetBeans IDE 安装目录中的 etc/netbeans.conf 文件中的 -Xmx 值。
\n\n但该错误应该与 netbeans.conf 无关,它应该类似于 VisualVM.conf 文件。而且我的jdk里也没有找到配置文件。那么我该如何解决这个错误呢?
\n当我尝试执行应用程序启动分析时,Profiled application started too soon附有下面的错误消息屏幕截图。
在我强行终止先前分析的应用程序后,会显示此警告。已重新启动我的系统,但仍然显示该警告。
提前致谢。
VisualVM做得非常好,每个完整的主类名都显示在左侧栏导航中.这些名字是如何检索的?Attach API为所有正在运行的JVM提供显示名称,但是,某些显示名称看起来有点膨胀,例如Eclipse:
C:\Program Files\Eclipse\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -os win32 -ws win32 -arch x86_64 -showsplash -launcher C:\Program Files\Eclipse\eclipse.exe -name Eclipse --launcher.library C:\Program Files\Eclipse\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1.R36x_v20100810\eclipse_1309.dll -startup C:\Program Files\Eclipse\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -exitdata 1084_58 -product org.eclipse.epp.package.jee.product -vm C:\Windows\system32\javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m -XX:MaxPermSize=256m -jar C:\Program Files\Eclipse\plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
Run Code Online (Sandbox Code Playgroud)
VisualVM缩短它的位置: org.eclipse.equinox.launcher.Main
他们如何检索它?从当前的JVM中可以轻松获取所有线程的主类.
在多核计算机上,JVisualVM CPU使用率图表是否显示总机器CPU容量或其他内容?
例如,在具有16个内核的计算机上,如果我看到JVisualVM中的CPU使用率高达50%,那是否意味着相当于完全使用的8个内核?
我正在尝试在Eclipse 7开发的Windows 7 64位上使用Java VisualVM,遇到以下问题:
我有一个在Eclipse中运行的Java应用程序,但是当我打开jVisualVM时,在Local下的Applications中显示的唯一项目是VisualVM本身.
是否可以显示我的Java应用程序?我是否需要使用某些命令行参数启动它以允许VisualVM连接?我是否需要在Eclipse之外运行它?
我试图在Windows 7 64位上使用jvisualvm配置一个简单的Java应用程序.我正在使用Java 8和JDK 1.8.0_131.我能够看到我的应用程序并使用VisualVM的Sample选项卡,但是当我使用Profile选项卡的CPU选项时,我得到一个"Redefinition failed with error 62".此错误在线记录,常见的解决方案是在启动应用程序时包含标志-Xverify:none.但是,使用此标志对我没有影响.我已经尝试了JVisualVM本身和我的简单程序jar都没有区别.以下是我正在使用的终端命令.
使用Xverify和简单的程序.
java -jar SimpleProfile.jar -Xverify:none
Run Code Online (Sandbox Code Playgroud)
使用Xverify和jvisualvm
./jvisualvm.exe -J-Xverify:none
两者都是从Git Bash终端运行而没有效果.我也在CMD中尝试过类似的命令.
我的PC上没有管理员权限,我注意到我无法使用Windows资源监视器.这可能与问题有关,还是我的论点有问题?
额外信息:当探查器失败时,我在终端中收到以下错误
Profiler Agent: Waiting for connection on port 5140 (Protocol
version: 15)
Profiler Agent: Established connection with the tool
Profiler Agent: Local accelerated session
Profiler Agent Error: Redefinition failed for classes:
sun.nio.fs.NativeBuffer$Deallocator
sun.rmi.transport.DGCImpl$1
sun.rmi.transport.tcp.TCPTransport$AcceptLoop
sun.rmi.transport.DGCAckHandler$1
com.profiletest.Main
sun.nio.ch.FileChannelImpl$Unmapper
java.io.DeleteOnExitHook$1
java.util.ResourceBundle$RBClassLoader
java.util.concurrent.ThreadPoolExecutor$Worker
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask
java.lang.ref.Reference$ReferenceHandler
java.lang.ClassLoader
java.util.logging.LogManager$Cleaner
com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout
java.lang.ApplicationShutdownHooks$1
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler
java.util.concurrent.FutureTask
java.lang.ref.Finalizer$FinalizerThread
java.lang.reflect.Method
Profiler Agent Error: with message: Redefinition failed with
error …Run Code Online (Sandbox Code Playgroud)