jmap
环境:
现有一个独立运行的系统S(有独立的jre,但是没jdk),现想通过jmap导出其内存堆栈信息。于是另外安装一个jdk。可是jdk的版本跟S系统的jre不能对应上。出了很多错误。
总是报错:
C:\Program Files\Java\jdk1.7.0_04\bin>jmap -dump:format=b,file=D:/test/test_mem.
bin 15112
Dumping heap to D:\test\test_mem.bin ...
Exception in thread "main" java.io.IOException: 拒绝访问。
at sun.tools.attach.WindowsVirtualMachine.enqueue(Native Method)
at sun.tools.attach.WindowsVirtualMachine.execute(WindowsVirtualMachine.
java:96)
at sun.tools.attach.HotSpotVirtualMachine.executeCommand(HotSpotVirtualM
achine.java:217)
at sun.tools.attach.HotSpotVirtualMachine.dumpHeap(HotSpotVirtualMachine
.java:180)
at sun.tools.jmap.JMap.dump(JMap.java:242)
at sun.tools.jmap.JMap.main(JMap.java:140)
C:\Users\Administrator>jmap -dump:format=b,file=test_mema.bin 10036
10036: Unable to attach to 64-bit process
linux:/opt/software/jdk1.7.0_09/bin # ./jmap -F -dump:format=b,file=test_mema.bin 8152
Attaching to process ID 8152, please wait...
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at sun.tools.jmap.JMap.runTool(JMap.java:197)
at sun.tools.jmap.JMap.main(JMap.java:128)
Caused by: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 23.5-b02. Target VM is 24.51-b03
at sun.jvm.hotspot.runtime.VM.checkVMVersion(VM.java:234)
at sun.jvm.hotspot.runtime.VM.<init>(VM.java:297)
at sun.jvm.hotspot.runtime.VM.initialize(VM.java:367)
at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:598)
at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:493)
at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:331)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:77)
... 6 more
Attaching to process ID 8152, please wait...
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xf6934777, pid=10859, tid=2925202288
#
# JRE version: 6.0_29-b11
# Java VM: Java HotSpot(TM) Server VM (20.4-b02 mixed mode linux-x86 )
# Problematic frame:
# C [libsaproc.so+0x1777] long double restrict+0x1d
#
# An error report file with more information is saved as:
# /opt/software/jdk1.6.0_29/bin/hs_err_pid10859.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted
8152: Unable to open socket file: target process not responding or HotSpot VM not loaded
The -F option can be used when the target process is not responding
貌似 1.6 不支持F参数
后面换成了一个jdk1.7 64位的就ok了!
----------- 其实更简单的做法是,。 将安装好的jdk(jdk1.6以上版本),然后将其中jre覆盖S系统的jre,重启jre即可。
—— 不过在win7上还是一直报第一个错: "main" java.io.IOException: 拒绝访问。。。。
jmap的更多相关文章
- jvm系列(四):jvm调优-命令大全(jps jstat jmap jhat jstack jinfo)
文章同步发布于github博客地址,阅读效果更佳,欢迎品尝 运用jvm自带的命令可以方便的在生产监控和打印堆栈的日志信息帮忙我们来定位问题!虽然jvm调优成熟的工具已经有很多:jconsole.大名鼎 ...
- Jstack Jmap jstat
jstack jmap jstat 代码,这里以这个为例怎样使用jstack诊断Java应用程序故障 public class DeadLock { public static void main(S ...
- jmap之使用说明与JVM配置
详情可参见:http://blog.csdn.net/fenglibing/article/details/6411953. 1 2. 3.vi 打开查看,具体介绍请看上述链接. 4.查看tomcat ...
- JVM性能调优监控工具jps、jstack、jmap、jhat、jstat、hprof使用详解
摘要: JDK本身提供了很多方便的JVM性能调优监控工具,除了集成式的VisualVM和jConsole外,还有jps.jstack.jmap.jhat.jstat.hprof等小巧的工具,本博客希望 ...
- JVM性能调优监控工具jps、jstack、jmap、jhat、jstat使用详解(转VIII)
JVM本身就是一个java进程,一个java程序运行在一个jvm进程中.多个java程序同时运行就会有多个jvm进程.一个jvm进程有多个线程至少有一个gc线程和一个用户线程. JDK本身提供了很多方 ...
- jmap命令详解(转)
1.命令基本概述 Jmap是一个可以输出所有内存中对象的工具,甚至可以将VM 中的heap,以二进制输出成文本.打印出某个java进程(使用pid)内存内的,所有‘对象’的情况(如:产生那些对象,及其 ...
- jmap命令(Java Memory Map)(转)
JDK内置工具使用 一.javah命令(C Header and Stub File Generator) 二.jps命令(Java Virtual Machine Process Status To ...
- jmap,jhat分析内存
分析JAVA Application的内存使用时,jmap是一个很实用的轻量级工具.使用jmap可以查看heap空间的概要情况,粗略的掌握heap的使用情况.也可以生成heapdump文件,再使用jh ...
- jmap命令详解
1.命令基本概述 Jmap是一个可以输出所有内存中对象的工具,甚至可以将VM 中的heap,以二进制输出成文本.打印出某个java进程(使用pid)内存内的,所有‘对象’的情况(如:产生那些对象,及其 ...
随机推荐
- Nodejs在centos下的安装
新学了nodejs,发现在centos下面安装的时候,与windows有一些不同的地方,以前习惯在安装不上的时候,去百度出来,解决了以后,当时都记住如何解决的了,但是过了一段时间以后,就全都忘记光了, ...
- UITabar 设置字体大小/颜色
1.设置被选中字体颜色 [self.tabBarController.tabBar setTintColor:[UIColor blackColor]];
- Hadoop streaming模式获取jobconf参数
1. 像map_input_file这种环境变量是在hadoop-streaming.jar程序中设置的,所以无需-cmdenv map_input_file参数就可以在php中直接引用,如$var= ...
- js 根据名字获取cookie 的方法
function getcookie(c_name) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf( ...
- javascript鸭式辩型法实现接口
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...
- onselectstart和onselect的使用
1.onselectstart 这个事件主要是用于禁止选择网页中的文字.代码为: document.onselectstart =function(){ return false; } 另外ff/op ...
- 【洛谷P2513】逆序对数列
前缀和.滚动数组优化dp f[i][j]表示前i个数,逆序对数为j的方案数 我们知道,在第k个位置放第i个数,单步得到的逆序对数为i-k 则在前i个数,最多能产生的逆序对数为i个,最少0个,均可转移到 ...
- Centos7.2 yum配置
一.yum 简介 yum,是Yellow dog Updater, Modified 的简称,是杜克大学为了提高RPM 软件包安装性而开发的一种软件包管理器.起初是由yellow dog 这一发行版的 ...
- WPF 图片显示中的保留字符问题
在WPF中显示一张图片,本是一件再简单不过的事情.一张图片,一行XAML代码即可. 但是前段时间遇到了一件奇怪的事: 开发机上运行正常的程序,在某些客户机器上却显示不了图片,而且除了这个问题,其它运行 ...
- jQuery实现锚点平滑定位
一般的锚点,就是点击一个按钮或者其他元素可以实现定位效果,当然可以使用锚点实现,但是这个不够美观,没有平滑的动画过渡效果,下面就通过代码实例介绍一下利用jquery实现平滑的定位效果. <!DO ...