Name: tb29552 Date: 10/01/2001
(Submitted via email to ###@###.###)
Hi,
Although the HPROF source code is provided by Sun 'as-is' and is not subject
to support I thought you might want to know that the code provided from the
http://java.sun.com/j2se/1.3/docs/guide/jvmpi/jvmpi.html#hprof document at
the bottom (http://java.sun.com/j2se/1.3/docs/guide/jvmpi/hprof.zip) does
not run.
This code blows up with an 'out of memory' exception.
The problem is at line 149 in the hprof_class.c file
hstatics = (hprof_field_t *) hprof_calloc(num_statics *
sizeof(hprof_field_t));
When the 'num_statics' value is zero the 'hprof_calloc' function calls
'malloc' with a size of 0 causing malloc to return NULL which causes
'hprof_calloc' to report an 'out of memory' exception.
This line of code (and others like it at line 148 and 156) should only be
called with non-zero values.
Thanks for providing the code, however. It is very useful in understanding
how the profiler interface works.
======================================================================
- duplicates
-
JDK-4342999 Get HotSpot to run effectively with Electric Fence.
-
- Closed
-