--- old/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java 2017-08-03 23:36:42.031659369 +0900 +++ new/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java 2017-08-03 23:36:41.891659043 +0900 @@ -37,6 +37,11 @@ import sun.jvm.hotspot.utilities.*; public class HTMLGenerator implements /* imports */ ClassConstants { + + private static final String ADDRESS_FORMAT = VM.getVM().isLP64() ? "0x%016x" : "0x%08x"; + + private static final String LOCK_OUTPUT = " - locked <" + ADDRESS_FORMAT + "> (a %s)"; + static class Formatter { boolean html; StringBuffer buf = new StringBuffer(); @@ -1948,6 +1953,13 @@ } buf.append(")"); buf.br(); + + vf.getMonitors() + .stream() + .map(m -> m.ownerIsScalarReplaced() ? m.ownerKlass() : m.owner()) + .map(m -> String.format(LOCK_OUTPUT, m.asLongValue(), Oop.getKlassForOopHandle(m).getName().asString().replace('/', '.'))) + .peek(buf::append) + .forEach(s -> buf.br()); } buf.endTag("pre");