The UseLinuxPosixThreadCPUClocks flag was added in Java 6 (JDK-6200022) to control which of two mechanisms was used to obtain the thread CPU time. When true it caused used of the new clock_gettime API with a suitable CLOCK_THREAD_CPUTIME_ID value. When false it caused use of the existing slower reading of /proc/self/<thread>/stat for the information. At the time the Linux implementation of clock_gettime could be incorrect and so you had to opt-in to the faster mechanism if you knew it was working at runtime.
In Java 6u23 and 7 UseLinuxPosixThreadCPUClocks was enabled by default (as it greatly improved performance of the associated Java-level API - seeJDK-6888526) and you could opt out if your Linux kernel did not support it.
Roll forward to JDK 24 and there is no reason for anyone to need to opt-out of this code, so the flag can be deprecated and then removed in the next release. We should also be able to remove the original /proc/self/<thread>/stat reading code.
In Java 6u23 and 7 UseLinuxPosixThreadCPUClocks was enabled by default (as it greatly improved performance of the associated Java-level API - see
Roll forward to JDK 24 and there is no reason for anyone to need to opt-out of this code, so the flag can be deprecated and then removed in the next release. We should also be able to remove the original /proc/self/<thread>/stat reading code.
- csr for
-
JDK-8338949 Deprecate the `UseLinuxPosixThreadCPUClocks` flag and remove it in a future release
-
- Closed
-
- relates to
-
JDK-8339019 Obsolete the UseLinuxPosixThreadCPUClocks flag
-
- Resolved
-
-
JDK-6200022 JVMTI GetCurrentThreadCpuTime slow on Linux
-
- Resolved
-
-
JDK-6888526 Linux getCurrentThreadCpuTime is drastically slower than Windows
-
- Closed
-
- links to
-
Commit(master) openjdk/jdk/16df0907
-
Review(master) openjdk/jdk/20710
(1 links to)