United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6215480 HPROF: broken when used with HAT, starting with 1.5.0_01, Missing thread dump
6215480 : HPROF: broken when used with HAT, starting with 1.5.0_01, Missing thread dump

Details
Type:
Bug
Submit Date:
2005-01-08
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2005-01-27
Component:
tools
OS:
generic
Sub-Component:
hprof
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
5.0u3

Related Reports
Backport:
Relates:

Sub Tasks

Description
Is Hat working with java 1.5
Posted on 
http://forum.java.sun.com/thread.jspa?threadID=584157&tstart=0


Author: astesana 		Jan 5, 2005 3:07 AM 	
Hello,

I'm trying to have HAT 1.1 working ... and it's a nightmare.
I've tried with various jdk version, various options, various classes ... and I always have the same exception running HAT :

java.io.IOException: Thread 200003 not found for JNI local ref
at hat.parser.HprofReader.getThreadObjectFromSequence(HprofReader.java:5
77)
at hat.parser.HprofReader.readHeapDump(HprofReader.java:408)
at hat.parser.HprofReader.read(HprofReader.java:221)
at hat.parser.Reader.readFile(Reader.java:90)
at hat.Main.main(Main.java:149)

Here is the very complex program I use to make my test ;-)
public class Test {
public static void main(String[] args) {
System.out.println ("Hello world");
}
}

I first run the Test class with jdk 1.5.0.01 using this command line :
java -agentlib:hprof=file=dump.hprof,format=b Test

I (try to) run hat with the following :
java -jar hat.jar c:/chezjma/eclipseWorkspace3.0/fourreTout/dump.hprof

and obtain the exception mentionned previously.

I've also tried with java 1.4.2.05 ... and obtain the same result. I work on a Windows XP platform.

Does somebody already succeed in the HAT 1.1 quest ?
What did I do wrong ?

Thank's for your help.
 
Re: Is Hat working with java 1.5
Author: timbell 		Jan 6, 2005 9:24 PM (reply 1 of 4) 	
First of all, for anyone following along, the Heap Analysis Tool (HAT) is available here:
https://hat.dev.java.net/

There are some open reports on these HAT problems. Check the HAT issue list (available at the URL listed above) for more information. Look for "Issue tracker" on the left sidebar.
 
Re: Is Hat working with java 1.5
Author: astesana 		Jan 7, 2005 1:25 AM (reply 2 of 4) 	
Thank's for your answer.

I've already had a look on these issues. There are two currently opened.
The first one says "I have problems using HAT under Suse Linux and JDK 1.3/1.4, but it works on windows".
The second one says "I have problem with jdk 1.5 ONLY when I try to compare two dumps". Reading that, I was expecting HAT could display a very simple heap dump.

I can't imagine that despite the jdc december communication, HAT is not working at all with jdk 1.5. I migth do something wrong :-(
 
Re: Is Hat working with java 1.5
Author: jdcamity 		Jan 8, 2005 6:03 AM (reply 3 of 4) 	
Hi,

I get an error like HPROF file does not have java.lang.Class
-Null Pointer Exception.

Trying with J2SE1.5_0_1 version, HAT 1.1 on Windows XP.

Pl get back if someone ever faced similar error.

Thanx-Srila
 
Re: Is Hat working with java 1.5
Author: kellyohair 		Jan 8, 2005 1:22 PM (reply 4 of 4) 	
This looks like a regression in 1.5.0_01. This thread has exited or is in the process of exiting, so the dump is reflecting a strange situation where the thread block data still seems to reference the thread, but the thread itself no longer exists. I'll investigate this and file a bug asap.
Thanks for the post.

The hprof format=b output has always been experimental, but all indications early on with 1.5 showed that HAT was working ok with it in most cases. I've been trying to bring in HAT as part of the J2SE (as an unsupported tool) if for no other reason than to run some HAT tests on a regular basis and make sure things like this don't happen.

I don't think this problem is related to Windows, it's happening on Solaris too. It probably has more to do with how fast threads can exit than anything else.
###@###.### 2005-1-08 21:36:23 GMT

                                    

Comments
SUGGESTED FIX

See 'diffs' attachment.
###@###.### 2005-1-19 01:30:53 GMT
                                     
2005-01-19
EVALUATION

Looking into this now.
###@###.### 2005-1-12 22:54:26 GMT

Problem appears to be Thread objects in the heap dump that aren't listed as
active threads in the thread dump. Needed to base thread list off of all
Thread objects still in the heap.

No testcase will be putback with this, but a separate bug/rfe will create
a HAT app in the J2SE and some HAT testcases will hopefully be generated
with that change (see 5102009).
###@###.### 2005-1-19 01:30:28 GMT
                                     
2005-01-12



Hardware and Software, Engineered to Work Together