if I run a take a sample using YourKit of the following sample code:
Code: Select all
private void run() throws Exception {
for (int index = 0; index < 1000; index++) {
justSleep();
waitForReentrantLock();
}
}
private void justSleep() throws InterruptedException {
System.out.println("Sleeping");
Thread.sleep(1000);
}
private void waitForReentrantLock() throws InterruptedException {
System.out.println("Waiting");
long endTime = System.currentTimeMillis() + 1000;
ReentrantLock lock = new ReentrantLock();
lock.lock();
synchronized (lock) {
lock.newCondition().awaitUntil(new Date(endTime));
}
lock.unlock();
}
Code: Select all
walltime=*
I tried it in regular attach mode, and with the yourkit agent loaded, on both Linux and Windows.
I this a known issue? Is there a way in which I can sample this time? If I cannot, are there other calls like this that cannot be monitored?
I found another post about this here: viewtopic.php?f=2&t=3362
But that post is quite old. It also says it is a generic JVM issue, but that is not true, because when sampling from jvisualvm this the waitForReentrantLock is measured just fine.