[PLUG] how to obtain a java vm stack dump

Carlos Konstanski ckonstanski at pippiandcarlos.com
Sun Apr 29 19:49:22 UTC 2007


On Thu, 26 Apr 2007, Carlos Konstanski wrote:

> Date: Thu, 26 Apr 2007 08:36:02 -0600 (MDT)
> From: Carlos Konstanski <ckonstanski at pippiandcarlos.com>
> Reply-To: "General Linux/UNIX discussion and help;	civil and on-topic"
>     <plug at lists.pdxlinux.org>
> To: "General Linux/UNIX discussion and help;	civil and on-topic"
>     <plug at lists.pdxlinux.org>
> Subject: Re: [PLUG] how to obtain a java vm stack dump
> 
> On Wed, 25 Apr 2007, tkubaska at charter.net wrote:
>
>>  Date: Wed, 25 Apr 2007 17:45:38 -0700
>>  From: tkubaska at charter.net
>>  Reply-To: "General Linux/UNIX discussion and help;	civil and on-topic"
>>      <plug at lists.pdxlinux.org>
>>  To: PLUG <plug at lists.pdxlinux.org>
>>  Subject: [PLUG] how to obtain a java vm stack dump
>>
>>  I have a simple question . and yes, I've googled and tried some things,
>>  but I dont have enough experience to evaluate whether I'm doing the right
>>  stuff and would appreciate some guidance. I want to obtain a java vm stack
>>  dump.
>>
>>  Here's what I tried . is this the right thing to do?
>>  jstack -m 5037
>>  where 5037 is the pid of my java program.
>>
>>  I'm running on Suse 10.2 and -m and -h seem to be the only jstack options
>>  that man jstack gives me; but docs on Internet list many other convenient
>>  options.  My java is Sun's 1.5.0.0_011 JDK.
>>
>>  My java program hangs and I'm trying to find out why. Interesting that it
>>  does not hang on other Linux distros using the same JDK.
>>
>>  Thanks.
>>  -ted
>
> For seeing what is going on inside a JVM at runtime, the most complete
> solution is a profiler.  When I get a chance later today, I will
> explain exactly how to set up a JVM to run under a free, open source
> one.
>
> Carlos Konstanski

http://www.khelekore.org/jmp/

This java profiler is very simple to use, and very effective.  I
cannot access the user's guide right now due to technical difficulties
with the website, and my emacs JDE prj.el file that contained my
config got overwritten with a "cleaned up" version, which leaves me
unable to provide detailed instructions here.  Perhaps you'll have
better luck with the website.  If I remember correctly, I only needed
to add "-Xrunjmp" to my java command line to make jmp fire up.

jmp is available in the gentoo portage tree.  Perhaps other distros
include it in their package sets as well.  It's always nice to use
package-managed solutions whenever possible.

Carlos Konstanski



More information about the PLUG mailing list