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

[windows] os::getTimesSecs() returns negative values for kernel, user times

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 9
    • 9
    • hotspot
    • None
    • b112
    • windows

      os::getTimesSecs() has a bug which causes it to return negative values for kernel and user times for a process because the code misunderstands the return values of GetProcessTimes().

      Even though both values are of type FILETIME, the returned values are in number of 100ns units since process start, not since 1601, and therefore the normal windows-to-java-time-translation cannot be used.

      This does not cause any bugs yet because os::getTimesSecs() is only used within the TraceCPUTime class, which takes two measurements and uses the delta.

            stuefe Thomas Stuefe
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: