<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bashton Blog &#187; Java</title>
	<atom:link href="http://blog.bashton.com/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bashton.com</link>
	<description>Bashton Ltd</description>
	<lastBuildDate>Tue, 13 Apr 2010 05:30:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Debugging Java application Problems</title>
		<link>http://blog.bashton.com/2009/debugging-java-application-problems/</link>
		<comments>http://blog.bashton.com/2009/debugging-java-application-problems/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 16:11:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jvm]]></category>

		<guid isPermaLink="false">http://blog.bashton.com/2009/debugging-java-application-problems/</guid>
		<description><![CDATA[After spending far too much time investigating a particularly thorny problem with a Java app, here&#8217;s a brief guide for anyone else stuck in the same predicament.
First, find some general information on the environment:

Show the JVM system properties
jinfo [pid]
Show heap space usage
jmap -heap [pid]
Show object memory usage
jmap -histo [pid]
Next, find out some more specifics about [...]]]></description>
			<content:encoded><![CDATA[<p>After spending far too much time investigating a particularly thorny problem with a Java app, here&#8217;s a brief guide for anyone else stuck in the same predicament.</p>
<p>First, find some general information on the environment:</p>
<p><strong><br />
Show the JVM system properties</strong></p>
<pre>jinfo [pid]</pre>
<p><strong>Show heap space usage</strong></p>
<pre>jmap -heap [pid]</pre>
<p><strong>Show object memory usage</strong></p>
<pre>jmap -histo [pid]</pre>
<p>Next, find out some more specifics about what the app is actually doing:</p>
<p><strong>Take a thread dump</strong></p>
<pre>pkill -3 java; sleep 5; pkill -3 java</pre>
<p>We do the kill -3 twice to show if threads are stuck in a particular state &#8211; add more as required.  The thread dump is written to stdout for the java process.  This will be catalina.out for a Tomcat app, elsewhere for others, check the init script for clues.</p>
<p><strong>Take a stack trace</strong></p>
<pre>jstack [pid]</pre>
<p>For apps using JNI you can take a mixed-mode trace by doing</p>
<pre>jstack -m [pid]</pre>
<p>and piping the output through c++filt.  On Solaris, c++filt can be obtained as part of <a href="http://developers.sun.com/sunstudio/downloads/express/">Sun Studio Express</a></p>
<p>Hopefully by this point you should have enough data to at least give you some clues as to where the problems are occuring.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bashton.com/2009/debugging-java-application-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
