问题描述
我已经花了很长时间来加载和测试我的应用程序,现在我需要对其进行分析。但不幸的是,VisualVM总是说我的本地应用程序不支持这个JVM?
I have already spent a long time to load and test my application, now I need to profile it. But unluckily, the VisualVM always says "not supported for this JVM" on my local applications?
应用程序是在与VisualVM相同的JVM上启动的。
The applications were started on the same JVM with VisualVM.
推荐答案
我发现(至少在Windows下)可以轻松编写小批量文件来运行VisualVM并结合特定的JVM,这对于我,因为我已经安装了32位JDK和64位JDK(我需要两者,所以这对我来说是明智的)。
我在S:\ applications \visualvm \ bin \文件夹中创建了两个批处理文件:
I found out that (at least under Windows) one can easily write small batch files to run VisualVM in combination with specific JVMs, which is important for me, since I have installed the 32bit JDK alongside with the 64bit JDK (I need both, so this is sensible for me).I have created two batch files in the folder "S:\applications\visualvm\bin\":
run_32.bat:
run_32.bat:
@echo off
START "VisualVM 32" visualvm.exe --jdkhome "C:\Program Files (x86)\Java\jdk1.7.0_07"
run_64.bat:
run_64.bat:
@echo off
START "VisualVM 64" visualvm.exe --jdkhome "C:\Program Files\Java\jdk1.7.0_07"
显然,您的系统上的所有路径可能都不同,但总体思路仍应正常工作(在所有64位版本的Windows上)。好处是,当我想将VisualVM与在32位JVM上运行的Java应用程序结合使用时,我可以使用32位批处理文件,依此类推64位。
Obviously, all paths may differ on your system, but the general idea should still work correctly (on all 64bit versions of Windows). The benefit is that I can use the 32bit batch file when I want to use VisualVM in combination with Java applications that run on the 32bit JVM, and so on for 64bit.
start命令具有批处理文件启动应用程序而不等待它完成的唯一好处,因此命令提示符窗口立即关闭。这不是VisualVM的功能,而是Windows批处理文件解释器的功能。
The "start" command has the only benefit that the batch file launches the application without waiting for it to finish, so the command prompt window closes immediately. This is not a feature of VisualVM, but of the Windows batch file interpreter.
这篇关于VisualVM“不支持此JVM”在所有本地应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!