jhat queries from command line

 There are several articles available on jhat and its usage

 http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html

jhat typically requires to you to run the server from a console and launch a web browser to walk through the heap dumps and run various OQL queriesThere maybe a lot of console (non-UI) based developers wanting to run queries or walk through the heap dump from command line and maybe redirect the various results to a file, thereby staying away from the browser. This could also be useful in cases where the heap dumps are quite huge and the browser UI takes a lot of time to load giving a "browser hang" impression to the user at times.

I have written one such tool that I currently call as JQuery and facilitates performing most of the operations from command line that you would normally do with mouse clicks on the browser

The tool covers most (if not all) of the common functionalities and infact interacts directly with jhat for every heap data output that you look for.

Note that the tool currently dumps output in html format and depending on the needs, I can make it dump output in text format for better readability.

 How to run the tool:

- Preqrequisties:  You need to have jhat server running on a heap dump obtained using jmap

 


- Compile and run the below JQuery class and connect to jhat server (see java JQuery -help for details)

JQuery.java

- Once you are connected, -help <enter> should give you list of commands that you can use to walk through heap dumps and/or redirect the output to a file

 

 

Would appreciate any comments about the functionality/improvements of this tool.
 

Thanks,

Kannan

 


 


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

kannan

Search

Categories
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