Wednesday, April 22, 2009

The inner beauty of jrockit jrcmd

see http://edocs.bea.com/jrockit/geninfo/diagnos/ctrlbreakhndlr.html

sample commands and their output:

jrcmd 12075 print_class_summary
12075:
- Class Summary Information starts here
class java/lang/Object
*class java/lang/ThreadLocal$1
*class [Ljava/util/List;
*class [Lsun/util/calendar/Era;
*class sun/util/calendar/Era
*class net/sf/saxon/sort/GenericSorter
*class net/sf/saxon/sort/SortedIterator
*class mx4j/tools/adaptor/http/CommandProcessorUtil$ToStringComparator
*class java/util/HashMap$1
*class java/lang/StringCoding$1
*class org/apache/xerces/util/DefaultErrorHandler
*class jrockit/vm/Memset
*class jrockit/vm/StringMaker
*class net/sf/saxon/expr/DifferenceEnumeration
*class net/sf/saxon/expr/IntersectionEnumeration
*class net/sf/saxon/expr/UnionEnumeration
.......


jrcmd 12075 print_object_summary increaseonly=true
12075:

--------- Detailed Heap Statistics: ---------
34.1% 1820k 19368 +1820k [C
15.3% 817k 765 +817k [B
11.9% 634k 5414 +634k java/lang/Class
8.0% 429k 18306 +429k java/lang/String
2.7% 144k 1517 +144k [I
2.2% 115k 1187 +115k [Ljava/lang/Object;
1.9% 101k 4315 +101k java/util/HashMap$Entry
1.9% 99k 1835 +99k [Ljava/lang/String;
1.5% 79k 559 +79k [Ljava/util/HashMap$Entry;
1.4% 72k 3108 +72k java/util/Hashtable$Entry
0.7% 37k 230 +37k [Ljava/util/Hashtable$Entry;
0.5% 27k 709 +27k java/lang/ref/SoftReference

jrcmd 12075 print_threads

===== FULL THREAD DUMP ===============
Wed Apr 22 11:26:57 2009
BEA JRockit(R) R27.3.1-1-85830-1.5.0_11-20070716-1248-linux-x86_64

"Thread-21" id=44 idx=0x4 tid=12075 prio=5 alive, in native, daemon

"(Signal Handler)" id=2 idx=0x8 tid=12076 prio=5 alive, in native, daemon

"(Code Generation Thread 1)" id=3 idx=0xc tid=12077 prio=5 alive, in native, native_waiting, daemon

"(Code Optimization Thread 1)" id=4 idx=0x10 tid=12078 prio=5 alive, in native, native_waiting, daemon

"(GC Main Thread)" id=5 idx=0x14 tid=12079 prio=5 alive, in native, daemon

"(GC Worker Thread 1)" id=? idx=0x18 tid=12080 prio=5 alive, in native, native_waiting, daemon

"(GC Worker Thread 2)" id=? idx=0x1c tid=12081 prio=5 alive, in native, native_waiting, daemon

"(VM Periodic Task)" id=6 idx=0x20 tid=12082 prio=10 alive, in native, daemon
.....


===== END OF THREAD DUMP ===============

jrcmd 12075 verbosity set=memory,memdbg,codegen,opt,sampling filename="output.log"

12075:
Current logstatus:
jrockit : level=WARN, decorations=201, sanity=NONE
memory (gc) : level=INFO, decorations=201, sanity=NONE
nursery (yc) : level=WARN, decorations=201, sanity=NONE
model : level=WARN, decorations=201, sanity=NONE
devirtual : level=WARN, decorations=201, sanity=NONE
codegen (code) : level=INFO, decorations=201, sanity=NONE
native (jni) : level=WARN, decorations=201, sanity=NONE
thread : level=WARN, decorations=201, sanity=NONE
opt : level=INFO, decorations=201, sanity=NONE
optq (optqueue) : level=WARN, decorations=201, sanity=NONE
callprof : level=WARN, decorations=201, sanity=NONE
load (lib) : level=WARN, decorations=201, sanity=NONE
ssa : level=WARN, decorations=201, sanity=NONE
constprop : level=WARN, decorations=201, sanity=NONE
inline : level=WARN, decorations=201, sanity=NONE
........



jrcmd 12075 timestamp
12075:
==== Timestamp ==== uptime: 5 days, 03:43:14 time: Wed Apr 22 17:07:33 2009





jrcmd 12075 print_memusage
12075:
[JRockit] memtrace is collecting data...
[JRockit] *** 0th memory utilization report
(all numbers are in kbytes)
Total mapped ;;;;;;;3527708
; Total in-use ;;;;;; 231656
;; executable ;;;;; 65460
;;; java code ;;;; 4928; 7.5%
;;;; used ;;; 4606; 93.5%
;; shared modules (exec+ro+rw) ;;;;; 5280
;; guards ;;;;; 492
;; readonly ;;;;; 0
;; rw-memory ;;;;; 171124
;;; Java-heap ;;;; 65536; 38.3%
;;; Stacks ;;;; 11862; 6.9%
;;; Native-memory ;;;; 93725; 54.8%
;;;; java-heap-overhead ;;; 2057
;;;; codegen memory ;;; 704
;;;; classes ;;; 38400; 41.0%
;;;;; method bytecode ;; 2916
;;;;; method structs ;; 4341 (#55573)
;;;;; constantpool ;; 17310
;;;;; classblock ;; 1999
;;;;; class ;; 2873 (#5434)
;;;;; other classdata ;; 4782
;;;;; overhead ;; 203
;;;; threads ;;; 55; 0.1%
;;;; malloc:ed memory ;;; 20259; 21.6%
;;;;; codeinfo ;; 1211
;;;;; codeinfotrees ;; 642
;;;;; exceptiontables ;; 337
;;;;; metainfo/livemaptable ;; 5081
;;;;; codeblock structs ;; 4
;;;;; constants ;; 11
;;;;; livemap global tables ;; 2085
;;;;; callprof cache ;; 0
;;;;; paraminfo ;; 94 (#1204)
;;;;; strings ;; 4020 (#65580)
;;;;; strings(jstring) ;; 0
;;;;; typegraph ;; 1343
;;;;; interface implementor list ;; 265
;;;;; thread contexts ;; 49
;;;;; jar/zip memory ;; 6626
;;;;; native handle memory ;; 39
;;;; unaccounted for memory ;;; 32303; 34.5%;1.59
---------------------!!!




jrcmd 12075 heap_diagnostics

======== BEGIN OF HEAPDIAGNOSTIC =========================

Invoked from diagnosticcommand

Total memory in system: 8377249792 bytes
Available physical memory in system: 1293717504 bytes
-Xmx (maximal heap size) is 4294967296 bytes
Heapsize: 4294967296 bytes
Free heap-memory: 3712605608 bytes

mmStartCompaction = 0x2b1e042b0000, mmEndCompaction = 0x2b1e082b0018


Memory layout:
00010000-003d0000 rwxp 00010000 00:00 0
00400000-00412000 r-xp 00000000 fd:04 1287492 /opt/jrmc-3.1.0-1.5.0/bin/java
00420000-004e0000 rwxp 00420000 00:00 0
00511000-00513000 rwxp 00011000 fd:04 1287492 /opt/jrmc-3.1.0-1.5.0/bin/java
00520000-07d60000 rwxp 00520000 00:00 0
07d7a000-0f9a5000 rwxp 07d7a000 00:00 0
0f9b0000-15ff0000 rwxp 0f9b0000 00:00 0
4005b000-4005d000 rwxp 4005b000 00:00 0
4005d000-40060000 ---p 4005d000 00:00 0
40060000-4009f000 rwxp 40060000 00:00 0
4009f000-400a2000 ---p 4009f000 00:00 0

--------- Detailed Heap Statistics: ---------
21.5% 72399k 637351 +0k [C
8.6% 29000k 281013 +0k [Ljava/lang/Object;
6.5% 21797k 697514 +0k java/lang/String
5.1% 17145k 31500 -59k [B
4.1% 13697k 87524 +0k [Ljava/util/HashMap$Entry;
2.7% 9274k 65950 +0k java/lang/reflect/Method
2.4% 8101k 207404 +0k java/util/HashMap$Entry
2.0% 6778k 173542 +0k com/bea/common/security/xacml/attr/StringAttribute
2.0% 6629k 33943 +0k java/lang/Class


337244kB total ---

--------- End of Detailed Heap Statistics ---
----- Reference Objects statistics separated per class -----
Total Reach Act PrevAct Null
----- ----- --- ------- ----
Finalizers:
5 2 3 0 0 Total for all Finalizers
2 1 1 0 0 => java/net/SocksSocketImpl
1 0 1 0 0 => weblogic/socket/WeblogicSocket
1 1 0 0 0 => java/net/SocketInputStream
1 0 1 0 0 => java/net/SocketOutputStream
----- End of Reference Objects statistics -----
------------------- Printing heap ---------------------
"o"/"p" = 1k normal/pinned objects
"O"/"P" = 50k normal/pinned objects
"."/"/" = <1k normal/pinned objects (fragmentation)
" "/"_" = 1k/50k free space
-------------------------------------------------------
//////o///o/p/oo/OOOoooooooooooooooooooooo/OOooooo 0x2b1dfe2f7c70
ooooooooo/OOOOOOooooooooooo/Oooooooooooooooooooooo 0x2b1dfe357b98
ooooooooooooo.. OOOOOOOoooooooooooooo./oooo 0x2b1dfe3b7ac0
oooooooooooooooooooooooo/OOooooooooooooooooooooooo 0x2b1dfe3dbce0
oooooooooooooooooooo/oooooooooooooooo/OOOOOooooooo 0x2b1dfe423d38
oooooooooooooooooooooooooooo. OOOooooooooooooooo 0x2b1dfe453ec0
ooooooooooooooooooooooooooo//..................... 0x2b1dfe460210
..............................Ooooooooooo/OOOOoooo 0x2b1dfe4a8268





the available commands are:

kill_rmp_server
start_rmp_server
kill_management_server
start_management_server
checkjrarecording
stopjrarecording
startjrarecording
print_object_summary
memleakserver
print_class_summary
print_codegenlist
run_optfile
dump_codelayout
dump_codelist
dump_codemap
print_utf8pool
print_properties
print_threads
datadump_request
runsystemgc
runfinalization
heap_diagnostics
oom_diagnostics
print_exceptions
version
timestamp
command_line
sanity
verbosity
set_filename
help
print_memusage




No comments: