Products | Versions |
---|---|
TIBCO Data Virtualization | - |
We typically observe entries in the thread dump that look something like this :
java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(java.base@11.0.12/Native Method) - waiting on <no object reference available> at java.lang.Object.wait(java.base@11.0.12/Object.java:328) at com.compositesw.server.cache.CacheTaskThread.waitForAutoCreate(CacheTaskThread.java:211)
This is a peculiarity of JVM. When dumping a stack, JVM recovers the wait object from the method local variables.
This info is available for interpreted methods, but not for compiled native wrappers.
When Object.wait is executed frequently enough, it gets JIT-compiled. After that there will be no "waiting on" line in a thread dump.
Since wait() must be called on a synchronized object, most often the wait object is the last locked object in the stack trace.