Heap dump on OutOfMemoryError  
Author Message
dmitry_jirov





PostPosted: 2003-6-26 16:13:00 Top

java-programmer, Heap dump on OutOfMemoryError Hi,

Is there any parameter that says to JVM to make a heap dump (objects)
on OutOfMemoryError? I've tried to use -Xrunhprof with :net= option,
but application becomes unacceptable slow. I need something that works
without invocation of JVMPI and makes dump only when exception occurs.

Thanks and Regards,
Dmitry
 
BAILEYC





PostPosted: 2003-6-26 18:33:00 Top

java-programmer >> Heap dump on OutOfMemoryError > Hi,
>
> Is there any parameter that says to JVM to make a heap dump (objects)
> on OutOfMemoryError? I've tried to use -Xrunhprof with :net= option,
> but application becomes unacceptable slow. I need something that works
> without invocation of JVMPI and makes dump only when exception occurs.
>
> Thanks and Regards,
> Dmitry

IBM JVMs have an internal heapdump mechanism that can be activated to
produce dumps when the JVM runs out of Java heap. If your using an IBM JVM
you might like to read the relevant Diagnosis Guide at:
http://www.ibm.com/developerworks/java/jdk/diagnosis/index.html

I believe most other tools for profiling the Java heap use the JVMPI, so
you'll have to accept some performance hit.
 
dmitry_jirov





PostPosted: 2003-6-26 20:50:00 Top

java-programmer >> Heap dump on OutOfMemoryError email***@***.com wrote in message news:<bdei4k$qi2$email***@***.com>...
> > Hi,
> >
> > Is there any parameter that says to JVM to make a heap dump (objects)
> > on OutOfMemoryError? I've tried to use -Xrunhprof with :net= option,
> > but application becomes unacceptable slow. I need something that works
> > without invocation of JVMPI and makes dump only when exception occurs.
> >
> > Thanks and Regards,
> > Dmitry
>
> IBM JVMs have an internal heapdump mechanism that can be activated to
> produce dumps when the JVM runs out of Java heap. If your using an IBM JVM
> you might like to read the relevant Diagnosis Guide at:
> http://www.ibm.com/developerworks/java/jdk/diagnosis/index.html
>
> I believe most other tools for profiling the Java heap use the JVMPI, so
> you'll have to accept some performance hit.

It could be great! But unfortunately I have to use SUN jdk1.3.1_08, any other ideas?
 
 
d94-rol





PostPosted: 2003-6-27 3:30:00 Top

java-programmer >> Heap dump on OutOfMemoryError : > Is there any parameter that says to JVM to make a heap dump (objects)
: > on OutOfMemoryError?
Not that I know of.

: > I've tried to use -Xrunhprof with :net= option,
: > but application becomes unacceptable slow. I need something that works
: > without invocation of JVMPI and makes dump only when exception occurs.

Why without jvmpi? Maybee you dont need to trace all the stuff, but
can still have a profiler attached.

: I believe most other tools for profiling the Java heap use the JVMPI, so
: you'll have to accept some performance hit.

Most tools do and there are some that modify the bytecode.

Anyway I develop the JMP profiler, http://www.khelekore.org/jmp/. It
has the possibility to run without most of the profiling options and
if tweaked it can run without all profiling options, it is also
controllable from within java (using a very thin and yet
underdeveloped JNI layer). Initializing the javalayer and running this
profiler you can then catch the OutofMemoryError and request it to do
a heap dump (. It is possible that it can work, but be aware that SUNs
jdk normally allocates a big byte buffer for the heap dump when a heap
dump request is made.

Good luck.
/robo