【已解决】win10 双jdk环境 执行jmap报错:sun.jvm.hotspot.runtime.VMVersionMismatchException:

报错信息

sun.jvm.hotspot.runtime.VMVersionMismatchException:Supported versions are 24.80-b11. Target VM is 25.191-b12

jmap运行报错

排查思路:

根据报错信息可以看出是jvm版本问题。经网上查询说是本机安装多个jdk导致,切换到具体的jdk bin目录下便可以正确执行.
的确,我在widows10环境下安装了jdk7和jdk8.但是切换到了jdk8目录下,但是依然报错如上图。检查了本地环境变量,没有发现问题。
如果你也遇到过同样的问题,请指正~~~~~~~~~~~~~~~~

二次修改:

在导出dump文件时,提示了如下信息:

Dumping heap to C:\Program Files\Java\jdk1.8.0_191\bin\heap.hprof ...
Permission denied

让我联想到是不是因为管理员的原因,然后用管理员打开Windows PowerShell,发现果然可以正常生成堆快照信息,我是该夸自己聪明呢 还是说自己蠢呢!!omg

问题解决:

PS C:\WINDOWS\system32> jmap -heap 33508
Attaching to process ID 33508, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.191-b12

using thread-local object allocation.
Parallel GC with 8 thread(s)

Heap Configuration:
   MinHeapFreeRatio         = 0
   MaxHeapFreeRatio         = 100
   MaxHeapSize              = 4263510016 (4066.0MB)
   NewSize                  = 89128960 (85.0MB)
   MaxNewSize               = 1420820480 (1355.0MB)
   OldSize                  = 179306496 (171.0MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 17592186044415 MB
   G1HeapRegionSize         = 0 (0.0MB)

Heap Usage:
PS Young Generation
Eden Space:
   capacity = 67108864 (64.0MB)
   used     = 52269976 (49.848533630371094MB)
   free     = 14838888 (14.151466369628906MB)
   77.88833379745483% used
From Space:
   capacity = 11010048 (10.5MB)
   used     = 8225904 (7.8448333740234375MB)
   free     = 2784144 (2.6551666259765625MB)
   74.71269880022321% used
To Space:
   capacity = 11010048 (10.5MB)
   used     = 0 (0.0MB)
   free     = 11010048 (10.5MB)
   0.0% used
PS Old Generation
   capacity = 101187584 (96.5MB)
   used     = 11048760 (10.536918640136719MB)
   free     = 90138824 (85.96308135986328MB)
   10.919086673716807% used

13164 interned Strings occupying 1174040 bytes.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值