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)内存内的,所有‘对象’的情况(如:产生那些对象,及其 ...
随机推荐
- 使用TFS 自动编译时的一点设置
MSBuild参数: /p:VisualStudioVersion=10.0 指定使用的VS编译版本
- 【Git】简单地使用github当做远程共享仓库
简单地使用github当做远程共享仓库 1.进入各自的github,选取一个人的github作为总的远程共享仓库,其余成员每次修改完项目后pull request请求合并自己的修改内容. 2.其余开发 ...
- Yosemite 快速搭建 自带Apache+PHP5.6+MySQL 开发环境
1.安装homebrew ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)" 2.安装h ...
- Qt Sqlite qwt 发布过程中碰到的问题runtime error
qt版本:4.8.0 qwt版本:6.1.2 使用dll show检测缺少的dll,或者笨一点的方法,点击运行差什么找什么放进去: 左上显示exe调用哪些dll,右边是dll又再次调用啦哪些dll: ...
- laravel中如何写验证码文件,并防止中文乱码.
本例为生成中文验证码,专为laravel而生. //控制器: public function getVcode(Request $request){ $width=845; $height=125; ...
- 【动态规划】bzoj1642 [Usaco2007 Nov]Milking Time 挤奶时间
区间按左端点排序,dp. #include<cstdio> #include<algorithm> using namespace std; #define N 1001 st ...
- 使用html2canvas实现网页截图并嵌入到PDF
以前我们只能通过截图工具进行截取图像.这使得在业务生产中,变得越来越不方便.目前的浏览器功能越来越强大,H5也逐渐普及,浏览器也可以实现截图了.这里来聊下之前在工作中用到的html2canvas.这里 ...
- React Native填坑之旅--Stateless组件
Stateless component也叫无状态组件.有三种方法可以创建无状态组件. 坑 一般一个组件是怎么定义的: 很久以前的方法: const Heading = createClass({ re ...
- struts2 国际化的一个日期封装bug
输入用户的生日:时间格式是yyyy-MM-dd,这样的.使用struts2,在action中有一个熟悉是:private Date birth;struts2在默认的情况下会将birth值自动绑定,简 ...
- On One Side Kolmogorov Type Inequalities
Let \(X_1,X_2,\ldots,X_n\) be independent random variables. Denote \[S_n=\sum_{i=1}^n X_i.\] The we ...