-
Bug
-
Resolution: Duplicate
-
P4
-
14
The product option PrintVMQWaitTime enables "log" printing by the VMThread, showing the time from a VMOperation being enqueued until it is removed from the queue by the VMThread. The message is only printed if the time is greater than 1ms.
The timestamp recorded in the VMOp is obtained via os::javaTimeMillis(), but the variable used is of type "long". On Windows the "long" type is 32bits, even on Win64. (The "long" type should be avoided in shared code because of the different sizes on different platforms.) As a result, the resulting time between enqueue and dequeue that will be reported is quote wrong.
There's an additional platform-independent problem with this mechanism, which is that os::javaTimeMillis() is subject to clock adjustment, making it unsuitable for such interval calculations.
The timestamp recorded in the VMOp is obtained via os::javaTimeMillis(), but the variable used is of type "long". On Windows the "long" type is 32bits, even on Win64. (The "long" type should be avoided in shared code because of the different sizes on different platforms.) As a result, the resulting time between enqueue and dequeue that will be reported is quote wrong.
There's an additional platform-independent problem with this mechanism, which is that os::javaTimeMillis() is subject to clock adjustment, making it unsuitable for such interval calculations.
- duplicates
-
JDK-8235741 Inappropriate uses of os::javaTimeMillis()
- Resolved
- relates to
-
JDK-8235765 Use of the long type should be avoided in shared code
- Resolved