JDK source: jhat

If you have downloaded JDK source from jdk6.dev.java.net, the sources for jhat (Java Heap Analysis Tool) is under $JDK/j2se/src/share/classes/com/sun/tools/hat directory. There is an ant build file (build.xml) to build just the jhat (jhat.jar is the build output). I mentioned about Object Query Language (SQL-like language to query Java Heap) support for jhat - you may want to refer to the following:

  • $JDK/j2se/src/share/classes/com/sun/tools/hat/internal/oql
  • $JDK/j2se/src/share/classes/com/sun/tools/hat/resources/hat.js

OQL is implemented using the JavaScript JSR-223 engine in JDK 6. select...from...where is parsed by a simple tokenizer. select and where expressions are JavaScript expressions. Also, if anything that does not start with "select" is directly "eval"-ed as JavaScript. You can use OQL form to write JavaScript functions - which you can call in subsequent OQL queries.

Comments:

Post a Comment:
Comments are closed for this entry.
About

sundararajan

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks
Links

No bookmarks in folder

Blogroll

No bookmarks in folder

News

No bookmarks in folder