<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Java Programming Forum - Learn Java Programming - Blogs - lovelesh</title>
		<link>http://www.java-forums.org/blogs/lovelesh/</link>
		<description>Java Programming Forum - Learning Java easily</description>
		<language>en</language>
		<lastBuildDate>Wed, 22 May 2013 22:43:01 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.java-forums.org/images/misc/rss.jpg</url>
			<title>Java Programming Forum - Learn Java Programming - Blogs - lovelesh</title>
			<link>http://www.java-forums.org/blogs/lovelesh/</link>
		</image>
		<item>
			<title>jmap - jdk provided heap observation utility</title>
			<link>http://www.java-forums.org/blogs/lovelesh/76-jmap-jdk-provided-heap-observation-utility.html</link>
			<pubDate>Sat, 25 Jun 2011 11:15:52 GMT</pubDate>
			<description>jmap is one of the lesser known jdk provided utilities, which are worth mentioning. Very oftenly we feel the need to peek into the jvm and see which...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">jmap is one of the lesser known jdk provided utilities, which are worth mentioning. Very oftenly we feel the need to peek into the jvm and see which thread is taking how much of heap space - jmap is jdks answer to this.<br />
<br />
This utility was introduced in jdk1.5 and is as an experimental utility (oracle may discontinue to ship this utility with future releases)<br />
<br />
Some of the notable features of jmap are:<br />
<br />
   1. can print shared object memory maps or heap memory details of a given process.<br />
   2. provides information about objects which are ready to be finalized.<br />
   3. provides information about heap configuration and algorithm used for Garbage Collection.<br />
   4. provides option to get information about loaded classes like, number of objects created, memory size in bytes, etc.<br />
   5. allows dumping of heap related info in binary file format. This file can be viewed with other jdk provided utilities like, jhat.<br />
   6. can provide statistical data related to associated class loaders.<br />
<br />
<font size="3"><b>Usage:</b></font><br />
<br />
jmap [ option ] pid<br />
jmap [ option ] executable core<br />
jmap [ option ] [server-id@]remote-hostname-or-IP<br />
<br />
<font size="3"><b>Options:</b></font><br />
<br />
<b><font size="2">&lt;no option&gt;</font></b><br />
When no option is used jmap prints shared object mappings. For each shared object loaded in the target VM, start address, the size of the mapping, and the full path of the shared object file are printed. This is similar to the Solaris pmap utility.<br />
<br />
<font size="2"><b>-dump:[live,]format=b,file=&lt;filename&gt;</b></font><br />
Dumps the Java heap in hprof binary format to filename. The live suboption is optional. If specified, only the live objects in the heap are dumped. To browse the heap dump, you can use jhat (Java Heap Analysis Tool) to read the generated file.<br />
<br />
<font size="2"><b>-finalizerinfo</b></font><br />
Prints information on objects awaiting finalization.<br />
<br />
<font size="2"><b>-heap</b></font><br />
Prints a heap summary. GC algorithm used, heap configuration and generation wise heap usage are printed.<br />
<br />
<b><font size="2">-histo[:live]</font></b><br />
Prints a histogram of the heap. For each Java class, number of objects, memory size in bytes, and fully qualified class names are printed. VM internal class names are printed with '*' prefix. If the live suboption is specified, only live objects are counted.<br />
<br />
<font size="2"><b>-permstat</b></font><br />
Prints class loader wise statistics of permanent generation of Java heap. For each class loader, its name, liveness, address, parent class loader, and the number and size of classes it has loaded are printed. In addition, the number and size of interned Strings are printed.<br />
<br />
<b><font size="2">-F</font></b><br />
Force. Use with jmap -dump or jmap -histo option if the pid does not respond. The live suboption is not supported in this mode.<br />
<br />
<b><font size="2">-h</font></b><br />
Prints a help message.<br />
<br />
<b><font size="2">-help</font></b><br />
Prints a help message.<br />
<br />
<font size="2"><b>-J&lt;flag&gt;</b></font><br />
Passes &lt;flag&gt; to the Java virtual machine on which jmap is run<br />
<br />
<b><font size="3">Example:</font></b><br />
<br />
<b>cmd&gt; jmap -heap 1234</b><br />
<br />
Attaching to process ID 1234, please wait...<br />
........<br />
........<br />
JVM version is 1.6.0_13-b03<br />
<br />
using parallel threads in the new generation.<br />
using thread-local object allocation.<br />
Concurrent Mark-Sweep GC<br />
............................<br />
............................<br />
............................</blockquote>

]]></content:encoded>
			<dc:creator>lovelesh</dc:creator>
			<guid isPermaLink="true">http://www.java-forums.org/blogs/lovelesh/76-jmap-jdk-provided-heap-observation-utility.html</guid>
		</item>
	</channel>
</rss>
