As of this version:
http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/file/8c188166869d/test/runtime/logging/MonitorInflationTest.java
$ java -Xlog:monitorinflation=debug -version
[0.129s][debug ][monitorinflation] Inflating object 0x0000000411006db0 , mark 0x00007f6760002c02 , type java.lang.ref.Reference$Lock
[0.129s][debug ][monitorinflation] Inflating object 0x00000004110078b0 , mark 0x00007f6760004c02 , type java.lang.Object
[0.144s][debug ][monitorinflation] Inflating object 0x000000041100b1a0 , mark 0x00007f6760004b02 , type java.lang.ref.ReferenceQueue$Lock
java version "9-internal"
Java(TM) SE Runtime Environment (build 9-internal+0-2015-12-15-132951.iklam.jdk9rt)
Java HotSpot(TM) 64-Bit Server VM (build 9-internal+0-2015-12-15-132951.iklam.jdk9rt, mixed mode)
[0.226s][debug ][monitorinflation] Deflating object 0x00000004110078b0 , mark 0x00007f6760004c02 , type java.lang.Object
The test assums that when running "java -version", some locks must have been inflated and at least one monitor must have been deflated. The single deflation, in the above output, is for the monitor that has been previously inflated here:
"Finalizer" #3 daemon prio=8 os_prio=0 tid=0x00007ffff040d000 nid=0x7976 runnable [0x00007ffecfb80000]
java.lang.Thread.State: WAITING (on object monitor)
JavaThread state: _thread_in_vm
Thread: 0x00007ffff040d000 [0x7976] State: _running _has_called_back 0 _at_poll_safepoint 0
JavaThread state: _thread_in_vm
1 - frame( sp=0x00007ffecfb80590, unextended_sp=0x00007ffecfb80590, fp=0x00007ffecfb805e8, pc=0x00007fffdd7b0898)
java.lang.Object.wait(Native Method)
2 - frame( sp=0x00007ffecfb805f8, unextended_sp=0x00007ffecfb80608, fp=0x00007ffecfb80660, pc=0x00007fffdd7924f3)
java.lang.Object.wait(Object.java:516)
3 - frame( sp=0x00007ffecfb80670, unextended_sp=0x00007ffecfb80670, fp=0x00007ffecfb806c8, pc=0x00007fffdd7924f3)
sun.misc.VM.awaitBooted(VM.java:175)
4 - frame( sp=0x00007ffecfb806d8, unextended_sp=0x00007ffecfb806e8, fp=0x00007ffecfb80728, pc=0x00007fffdd7924f3)
java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:208)
But this is really JDK internal implementation code, and could change. In fact, it has changed in the latest jake repo (the VM.awaitBooted) method has been removed.
We need to rewrite the test case to perform specific actions to ensure that monitor are inflated and/or deflated, without no dependency on internal JDK implementations.