Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8235740

PrintVMQWaitTime broken on Windows

XMLWordPrintable

      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.

            hseigel Harold Seigel (Inactive)
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: