< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java

Print this page

 58     tty.println();
 59     dumpOn(tty);
 60 
 61     textArea.setText(bos.toString());
 62   }
 63 
 64   private static void dumpMonitor(PrintStream tty, ObjectMonitor mon, boolean raw) {
 65     tty.print("ObjectMonitor@" + mon.getAddress());
 66     if (raw) tty.print("(Raw Monitor)");
 67     tty.println();
 68     tty.println("  _header: 0x" + Long.toHexString(mon.header().value()));
 69     OopHandle obj = mon.object();
 70     Oop oop = heap.newOop(obj);
 71     tty.println("  _object: " + obj + ", a " + oop.getKlass().getName().asString());
 72     Address owner = mon.owner();
 73     tty.println("  _owner: " + owner);
 74     if (!raw && owner != null) {
 75       JavaThread thread = threads.owningThreadFromMonitor(mon);
 76       if (thread != null) {
 77         tty.println("    owning thread: " + thread.getThreadName());
 78         if (!thread.getAddress().equals(owner)) {
 79           if (!thread.isLockOwned(owner)) {
 80             tty.println("    WARNING! _owner doesn't fall in " + thread +
 81                         "'s stack space");
 82           }
 83         }
 84       }
 85     }
 86     tty.println("  _contentions: " + mon.contentions());
 87     tty.println("  _waiters: " + mon.waiters());
 88     tty.println("  _recursions: " + mon.recursions());
 89   }
 90 
 91   private void dumpOn(PrintStream tty) {
 92     Iterator i = ObjectSynchronizer.objectMonitorIterator();
 93     if (i == null) {
 94       tty.println("This version of HotSpot VM doesn't support monitor cache dump.");
 95       tty.println("You need 1.4.0_04, 1.4.1_01 or later versions");
 96       return;
 97     }
 98     ObjectMonitor mon;
 99     while (i.hasNext()) {
100       mon = (ObjectMonitor)i.next();
101       if (mon.contentions() != 0 || mon.waiters() != 0 || mon.owner() != null) {
102         OopHandle object = mon.object();
103         if (object == null) {

 58     tty.println();
 59     dumpOn(tty);
 60 
 61     textArea.setText(bos.toString());
 62   }
 63 
 64   private static void dumpMonitor(PrintStream tty, ObjectMonitor mon, boolean raw) {
 65     tty.print("ObjectMonitor@" + mon.getAddress());
 66     if (raw) tty.print("(Raw Monitor)");
 67     tty.println();
 68     tty.println("  _header: 0x" + Long.toHexString(mon.header().value()));
 69     OopHandle obj = mon.object();
 70     Oop oop = heap.newOop(obj);
 71     tty.println("  _object: " + obj + ", a " + oop.getKlass().getName().asString());
 72     Address owner = mon.owner();
 73     tty.println("  _owner: " + owner);
 74     if (!raw && owner != null) {
 75       JavaThread thread = threads.owningThreadFromMonitor(mon);
 76       if (thread != null) {
 77         tty.println("    owning thread: " + thread.getThreadName());






 78       }
 79     }
 80     tty.println("  _contentions: " + mon.contentions());
 81     tty.println("  _waiters: " + mon.waiters());
 82     tty.println("  _recursions: " + mon.recursions());
 83   }
 84 
 85   private void dumpOn(PrintStream tty) {
 86     Iterator i = ObjectSynchronizer.objectMonitorIterator();
 87     if (i == null) {
 88       tty.println("This version of HotSpot VM doesn't support monitor cache dump.");
 89       tty.println("You need 1.4.0_04, 1.4.1_01 or later versions");
 90       return;
 91     }
 92     ObjectMonitor mon;
 93     while (i.hasNext()) {
 94       mon = (ObjectMonitor)i.next();
 95       if (mon.contentions() != 0 || mon.waiters() != 0 || mon.owner() != null) {
 96         OopHandle object = mon.object();
 97         if (object == null) {
< prev index next >