JDK-8354894 : java/lang/Thread/virtual/Starvation.java timeout on server with high CPUs
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 25,26
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-04-16
  • Updated: 2025-12-05
  • Resolved: 2025-10-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25 JDK 26
25.0.3-oracleFixed 26 b18Fixed
Related Reports
Causes :  
Description
The test test/jdk/java/lang/Thread/virtual/Starvation.java failed with timeout for default run on the Xeon 6780E based 2 sockets server (288 cores). 
Reporting message looks as:
============
TEST RESULT: Error. Program `jdk_mainline/build/linux-x86_64-server-release/images/jdk/bin/java' timed out (timeout set to 1600000ms, elapsed time including timeout handling was 1600491ms).
============

Note, the test passed with limited used CPU count to 170:
# make test TEST="java/lang/Thread/virtual/Starvation.java" JTREG="JOBS=1;TIMEOUT_FACTOR=8;JAVA_OPTIONS=-XX:ActiveProcessorCount=170"

The test should be updated to support modern servers.
Comments
[jdk25u-fix-request] Approval Request from Roland Mesde for backport of JDK-8354894: java/lang/Thread/virtual/Starvation.java timeout on server with high CPUs. For parity with Oracle JDK.
03-12-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk25u-dev/pull/49 Date: 2025-12-02 21:26:37 +0000
03-12-2025

Changeset: 0366d882 Branch: master Author: SendaoYan <syan@openjdk.org> Date: 2025-10-01 00:52:30 +0000 URL: https://git.openjdk.org/jdk/commit/0366d8823bc844225ca24964e352ce0a57d01683
01-10-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/27543 Date: 2025-09-29 08:52:04 +0000
29-09-2025

[~syan] No objection if you take it.
28-09-2025

Before apply the proposed patch, test run finish 257 seconds, after apply the proposed patch test run finish 1.2 seconds on the 2 sockets system with Intel(R) Xeon(R) Platinum 8480+
28-09-2025

Hi, Do we have plan to fix this issue. Or may I steal this issue and create a PR apply the proposed patch.
28-09-2025

With proposed changes this test passed on the 2 sockets system with Xeon 6740E. Command make test TEST="java/lang/Thread/virtual/Starvation.java" reports 'Error' for original run: ============================== Test summary ============================== TEST TOTAL PASS FAIL ERROR SKIP jtreg:test/jdk/java/lang/Thread/virtual/Starvation.java >> 1 0 0 1 0 << ============================== TEST FAILURE and 'Pass' for fixed test: ============================== Test summary ============================== TEST TOTAL PASS FAIL ERROR SKIP jtreg:test/jdk/java/lang/Thread/virtual/Starvation.java 1 1 0 0 0 ============================== TEST SUCCESS
30-07-2025

The test execution time is a function of the of the hardware threads so it run slower on these larger systems. I've attached a file to this JBS issue with a change to the test that will compute an iteration count for the test. Can you try this on these large systems to see if it helps?
30-07-2025

We are seeing similar timeout issues on machines with large number of CPUs. Is setting a flag like -XX:ActiveProcessorCount=8 explicitly in the test an acceptable solution? JDK-8314139 was a similar issue and used -XX:ActiveProcessorCount=2 to resolve it.
29-07-2025