jmap heap dump not working

2,826 views
Skip to first unread message

BarryC

unread,
Sep 15, 2011, 5:53:50 PM9/15/11
to cfaussie
Hi,

I'm trying to do a heap dump on Linux, it's running Coldfusion 9 with
JRun4, the JRE is 1.6.0_17 and it's all 64 bit.
When I run the command
./jmap -dump:format=b,file=./memdump.bin 4001

it says "error while loading shared libraries: libjli.so: cannot open
shared object file: No such file or directory"

I'm running jmap from;
/opt/jrun4/jre/bin/

but the libjli.so lives in
/opt/jrun4/jre/lib/amd64/jli/

Should be fine but isn't, any ideas?

Thanks
Barry.

Gavin Baumanis

unread,
Sep 15, 2011, 9:31:08 PM9/15/11
to cfaussie
Hi Barry,

I have these notes for running jmap on my mac.

// Check for this
ps -ef | grep hsdbd

// if it is running - kill it;
sudo kill -9 <pid>

// Get the PID of JRUN
sudo ps-ef | grep jrun

// Map the heap.
sudo jmap -dump:format=b,file=heap.bin <pid>


Hope this helps.

Gavin.

Barry Chesterman

unread,
Sep 16, 2011, 12:15:31 AM9/16/11
to cfau...@googlegroups.com
Those commands are similar to what I'm running (except I don't run the kill command on anything first)

did you have the JDK on your mac?
The jmap I'm running is a jmap I've put onto the Linux box specifically (the libjli.so was already there). Jmap wasn't on the box from the standard install, it is from a JDK I downloaded (which is supposed to be the same version of java which matches what's on the Linux box) I just copy the jmap file from the JDK stuff I downloaded.

Is it possible that the libjli.so file that is already on the linux box is not the one the jmap from the JDK I downloaded expects perhaps?

--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.


Gavin Baumanis

unread,
Sep 16, 2011, 12:46:24 AM9/16/11
to cfaussie
Hi Barry,

Yeah sorry, slight omission on my part.
I did download the "current" JDK.

I have no idea about library versions / mismatches - as I simply used
the "whole"JDK.

The process that is killed...
That might be specific to Mac - I don't exactly remember.
But it came about after some Googling - as I was having some real
issues with getting the dump to work.
and that seemed to solve it for me.
So now I just keep those lines in my clipboard manager for whenever I
need them.

I suppose the real questions is;
Does it matter if you use the whole JDK for getting jmap to work or
not?
Does using the JDK libraries simply allow the jmap application to use
appropriate libraries for it to run - or does it effect the way it
binds itself to the running process too - so that it does matter that
it does not match the JVM.
Could you not upgrade the JVM / JDK to be the same version?

Initially - I say - do whatever it takes to get it working... but I am
far from a java / library dependencies guru - so take it with a grain
of salt!

Gavin.

On Sep 16, 2:15 pm, Barry Chesterman <barrychester...@gmail.com>
wrote:
> Those commands are similar to what I'm running (except I don't run the kill
> command on anything first)
>
> did you have the JDK on your mac?
> The jmap I'm running is a jmap I've put onto the Linux box specifically (the
> libjli.so was already there). Jmap wasn't on the box from the standard
> install, it is from a JDK I downloaded (which is supposed to be the same
> version of java which matches what's on the Linux box) I just copy the jmap
> file from the JDK stuff I downloaded.
>
> Is it possible that the libjli.so file that is already on the linux box is
> not the one the jmap from the JDK I downloaded expects perhaps?
>

Simon Haddon

unread,
Sep 18, 2011, 1:24:46 AM9/18/11
to cfau...@googlegroups.com
Have you tried

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/jrun4/jre/lib/amd64/jli/

then run jmap

Cheers,
Simon
--
Cheers
Simon Haddon

Woman loves feeling danger and speed. That is why woman wants man.  They get a speed rush that is the most dangerous of all.

BarryC

unread,
Oct 4, 2011, 10:28:45 PM10/4/11
to cfaussie
Just to close off this thread,
I got around the issue by using the entire JDK, it would appear that
just using jmap on its own doesn't work with the standard JVM
libraries (no doubt jmap needs specific libraries that only come with
the JDK).
I just put the JDK (downloaded and extracted straight from the
downloads website) in it's own directory on the server, and called
jmap directly from there, which worked a treat.

Regards
Barry

On Sep 18, 6:24 pm, Simon Haddon <simon.had...@gmail.com> wrote:
> Have you tried
>
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/jrun4/jre/lib/amd64/jli/
>
> then run jmap
>
> Cheers,
> Simon
>
Reply all
Reply to author
Forward
0 new messages