- 浏览: 413931 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
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 907JVM 深入笔记(1)内存区域是如何划分的? 一个超短的前言 ... -
JVM启动参数
2011-06-10 16:27 930java [jvmargs] class [arguments ... -
JVM指令集 和 一个异常例子
2011-05-19 16:14 982指令码 助记符 说明 0x00 nop ... -
The Top Java Memory Problems – Part 1
2011-05-18 11:01 864转载:http://blog.dynatrace.com/20 ... -
BTrace使用简介
2011-04-19 13:51 750该文转载自:http://rdc.taobao.com/tea ... -
大方法的执行性能与调优过程小记
2011-04-18 16:20 760该文章转载自:http://rdc.taobao.com/te ... -
十个最好的Java性能故障排除工具
2011-04-18 16:02 886推荐十个最好的Java性能 ... -
两个OOM Cases排查过程的分享
2011-04-18 15:39 893分享一下两个OOM Cases的查找过程,一个应用是Nativ ... -
Monitoring Java garbage collection with jstat
2011-04-18 15:28 830The original article is at : ht ... -
理解Heap Profling名词-Shallow和Retained Sizes
2011-04-18 14:58 939所有包含Heap Profling功能的工具(MAT, You ... -
Java深度历险(四)——Java垃圾回收机制与引用类型
2011-04-01 08:18 926Java语言的一个重要特性 ... -
Thread Dump 和Java应用诊断
2011-03-30 08:08 1095Thread Dump 和Java应用诊断 ... -
Java Memory Leaks et al. (2. Act)
2011-03-14 15:37 895The first act of this blog-seri ... -
Erlang memory architecture vs Java memory architecture
2011-03-14 15:36 879I read a really, really interes ... -
The Java Memory Architecture (1. Act)
2011-03-14 15:15 1384One of the biggest strength of ... -
Permanent generation
2011-03-14 14:53 1198版权声明:转载时请以 ... -
JVM内存模型以及垃圾回收
2011-03-13 09:38 907内存由 Perm 和 Heap 组成. 其中 Heap ... -
Java虚拟机垃圾回收机制
2011-03-13 09:31 766一、相关概念 基本 ... -
JVM结构
2011-03-10 14:43 857类文件格式 JVM使用一 ... -
OOM与JVM(转)
2009-03-24 15:49 894OOM与JVM(转) 2008年08月08日 星期五 15: ...
相关推荐
Obtaining a Thread Dump Using WLS Memory: Define Java Heap Garbage Collection Review Configuring JRockit Heap Server Core Dump Pattern Identifying Server Core Dump Pattern Symptoms and Causes of a ...
有时候当你的程序崩溃时能获得堆栈轨迹是很有用处的。很多人认为当程序崩溃时用C/C++难以获知程序在哪出现了错误。在很大程度上,C/C++的确难以做到,但是调试器却能做到这一点。下文给出的程序可以做到不用调试器却...
Obtaining Absolute Encoder Position on a TMS320C240.pdf
C#C#A Method for Obtaining Digital Signatures and Public-Key Cryptosystems A Method for Obtaining Digital Signatures and Public-Key Cryptosystems A Method for Obtaining Digital Signatures and Public-...
abaqus Abaqus收敛培训教材Obtaining a Converged Solution with AbaqusC 2021 pdf
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 ...
* 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 * ...
However, because this technology is based on Java, you should first obtain a solid grasp of the Java language and its foundational APIs to improve your chances of succeeding as an Android app ...
5.5 Obtaining LL(1) Grammars 154 5.5.1 Common Prefixes 156 5.5.2 Left Recursion 157 5.6 A Non-LL(1) Language 159 5.7 Properties of LL(1) Parsers 161 5.8 Parse Table Representation 163 5.8.1 Compaction...
However, because this technology is based on Java, you should first obtain a solid grasp of the Java language and its foundational APIs to improve your chances of succeeding as an Android app ...
JEDEC JEP 142-2023 GUIDELINE FOR OBTAINING AND ACCEPTING MATERIAL FOR USE IN HYBRID MCM PRODUCTS.pdf
javax.sound.sampled.AudioSystem is the entry point to JavaSound for obtaining resources; i.e., mixers, lines, etc. And each method of AudioSystem involves getting the providers of some service—...
This book teaches you how to design and develop distributed web services in Java using RESTful architectural principles on top of the HTTP protocol. It is mostly a comprehensive reference guide on the...
电力潮流计算, 经济调度,...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 ...
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 ...
its objective consists in obtaining a clear, precise, and faithful, representation of all the “information” contained in a mathematical model; as such, it is the natural extension of more classical...
If you are a Scala, Java, or Python developer with an interest in machine learning and data analysis and are eager to learn how to apply common machine learning techniques at scale using the Spark ...
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...