- 浏览: 427103 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
Glogo:
楼主您好,我在试验您的代码的时候发现新开的三个子线程并没有一直 ...
java 高并发 ReentrantLock -- 可重入的锁 -
univasity:
最近发觉也被限速了,投诉一下就好一会~~ 看来明天又要和电信M ...
ADSL上网速度慢 都是帐号限速惹的祸 -
liuyuanhui0301:
java 高并发 ReentrantLock -- 可重入的锁 -
dang_java:
呵.很好的说明文档.
JXTA技术与应用发展 -
helloqidi:
谢谢,学习了
SQL中exists和in的区别
- With the command line tool jmap
- By using a provided MBean (Java Management Extension – JMX) and the tool jconsole
Of course, there is the possibility to use the Java Virtual Machine Tool Interface (JVMTI) to produce a dump – but therefore you would have to implement an agent in C. Many Profiling Tools (JProfiler, dynaTrace Diagnostics) provide a JVMTI agent to create and evaluate a heapdump with a GUI.
To automatically generate a heap dump when an OutOfMemoryError is thrown you have to provide this JVM command line parameter:
- XX:+HeapDumpOnOutOfMemoryError
The parameter causes the JVM to dump a HPROF headump to the current directory if an OutOfMemoryError occurs. The name of the dump is by convention java_pid.hprof. To specify the directory and the name of the file by yourself, you can add the parameter -XX:HeapDumpPath=path_to_file to the JVM command line options.
The automatic production of dumps with these parameters is not always useful. In some situations you want to produce a heapdump at any given time during application execution. In this case Java version 1.4.2_09, 1.5.x and 1.6.x provide the tool jmap. A HPROF heapdump can be requested by executing the following command:
map -dump:file=path_to_file java_process_id.
The provided Java process id determines which local JVM should be dumped. The process Id can be determined with the JVM Tool jps (Note: The jmap tool is not available on every platform and JVM version). You can alternatively use the JVM parameter -XX:+HeapDumpOnCtrlBreak and send a SIGQUIT signal (-3 kill for Unix and Ctrl-Break for Windows) to the running Java process – the signal will also create a heapdump without aborting the JVM.
With Java 6, Sun introduced a JMX MBean which provides methods for generating a heapdump. To create a heapdump via JMX you first start the integrated JMX console with the command jconsole and connect it to the corresponding JVM. For a local connection you don’t need any additional configuration of the JVM – for a connection to a remote machine you have to configure JMX correctly.
You can use the MBean Explorer of jconsole to find the correct MBean within the JVM. The MBean com.sun.management.HotSpotDiagnostic contains the alluded method dumpHeap (String, boolean). With the help of the first method parameter you can set the path and the name of the Heapdump. The screenshot shows the view of the MBean. Pressing on the dumpHeap button will create a heapdump with the given name.
The next part of this series will get into more details how to analyse heapdumps and find memory leaks and common memory antipatterns.
Information about heapdump generation with the IBM JVM can be found in the IBM JVM Diagnosis Documentation.
Information about BEA JRockit and the JRockit Memory Leak Detector can be found in the JRockit Dokumentation.
发表评论
-
JVM 深入笔记
2012-04-12 20:36 1000JVM 深入笔记(1)内存区域是如何划分的? 一个超短的前言 ... -
JVM启动参数
2011-06-10 16:27 964java [jvmargs] class [arguments ... -
JVM指令集 和 一个异常例子
2011-05-19 16:14 1018指令码 助记符 说明 0x00 nop ... -
The Top Java Memory Problems – Part 1
2011-05-18 11:01 903转载:http://blog.dynatrace.com/20 ... -
BTrace使用简介
2011-04-19 13:51 776该文转载自:http://rdc.taobao.com/tea ... -
大方法的执行性能与调优过程小记
2011-04-18 16:20 804该文章转载自:http://rdc.taobao.com/te ... -
十个最好的Java性能故障排除工具
2011-04-18 16:02 924推荐十个最好的Java性能 ... -
两个OOM Cases排查过程的分享
2011-04-18 15:39 929分享一下两个OOM Cases的查找过程,一个应用是Nativ ... -
Monitoring Java garbage collection with jstat
2011-04-18 15:28 858The original article is at : ht ... -
理解Heap Profling名词-Shallow和Retained Sizes
2011-04-18 14:58 974所有包含Heap Profling功能的工具(MAT, You ... -
Java深度历险(四)——Java垃圾回收机制与引用类型
2011-04-01 08:18 980Java语言的一个重要特性 ... -
Thread Dump 和Java应用诊断
2011-03-30 08:08 1130Thread Dump 和Java应用诊断 ... -
Java Memory Leaks et al. (2. Act)
2011-03-14 15:37 924The first act of this blog-seri ... -
Erlang memory architecture vs Java memory architecture
2011-03-14 15:36 909I read a really, really interes ... -
The Java Memory Architecture (1. Act)
2011-03-14 15:15 1411One of the biggest strength of ... -
Permanent generation
2011-03-14 14:53 1270版权声明:转载时请以 ... -
JVM内存模型以及垃圾回收
2011-03-13 09:38 983内存由 Perm 和 Heap 组成. 其中 Heap ... -
Java虚拟机垃圾回收机制
2011-03-13 09:31 824一、相关概念 基本 ... -
JVM结构
2011-03-10 14:43 888类文件格式 JVM使用一 ... -
OOM与JVM(转)
2009-03-24 15:49 966OOM与JVM(转) 2008年08月08日 星期五 15: ...
相关推荐
然后,它包含了一系列标准头文件,比如 `<memory.h>` 和 `<signal.h>`,以及用于符号解析的 `<execinfo.h>` 和 `<dlfcn.h>`。 核心部分在于定义了一个信号处理函数,该函数会在接收到 `SIGSEGV` 信号时被调用。这个...
1. **硬件配置**:首先,确保绝对编码器正确连接到TMS320C240的输入端口。通常,这涉及到选择合适的引脚并进行必要的信号调理。 2. **初始化设置**:在软件层面,需要对DSP进行初始化,包括设置时钟频率、中断...
"Obtaining a Converged Solution with Abaqus" 是一本专门针对Abaqus求解收敛问题的培训教材,旨在帮助用户理解和解决在进行有限元分析时遇到的收敛挑战。 教程分为两天的内容,涵盖了多个主题和工作坊,以理论...
#### 1. 数字签名概述 数字签名是一种用于验证电子信息来源的真实性及其完整性的一种方法。它利用了公钥加密技术,通过发送方使用自己的私钥对信息摘要进行加密,接收方则使用发送方的公钥解密来验证信息的真实性和...
Table of Contents Getting Started with Java Learning Language Fundamentals Learning Object-Oriented Language Features Mastering Advanced Language Features Part 1 Mastering Advanced Language Features ...
解决uiautomatorviewer报错问题,分享给大家。 Unexpected error while obtaining UI hierarchy # 点击Details java.lang.reflect.InvocationTargetException
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without * ...
电力潮流计算, 经济调度,...visualization tool aids students in quickly obtaining a detailed understanding of the power system analysis problems when used as a supplement to traditional lecture approaches.
domain user password obtaining
With this practical book, Java software engineers looking to add data science skills will take a logical journey through the data science pipeline. Author Michael Brzustowicz explains the basic math ...
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, ...
analysis. However, the quadratic time and space complexity as well as the intricacy of extracting the desired structural information from these matrices are often prohibitive with regard to real-world...
part 1. introduction chapter 1. introduction 1.1 introduction 3 1.2 processes, threads, and the sharing of information 5 1.3 persistence of ipc objects 6 1.4 name spaces 7 1.5 effect of fork, ...
c.dump the memory with three mode(Dump Full、Dump Partial and Dump Region) v1.2 new features: ★support PEid plugins ★add a feature for rebuilding PE v1.1 new features: ★add ...
**JEDEC JEP 142-2023 概述** JEDEC JEP 142-2023 是一个针对混合多芯片模块(Hybrid MCM)产品中材料获取与验收的指导标准。该标准由JEDEC固态技术协会发布,并在2002年首次制定,2009年和2023年进行了重新确认。...
Despite this growth, the competition in obtaining a career in video games remains as arduous as ever. Becoming a Video Game Artist helps guide readers from their first steps of making a portfolio, to...