Integrated: 8354560: Exponentially delay subsequent native thread creation in case of EAGAIN

Yannik Stradmann duke at openjdk.org
Mon May 19 21:30:58 UTC 2025


On Wed, 16 Apr 2025 10:34:18 GMT, Yannik Stradmann <duke at openjdk.org> wrote:

> This change introduces an exponential backoff when hitting `EAGAIN` during native thread creation in hotspot.
> 
> In contrast to the current solution, where we retry to create a native thread up to three times in a tight loop, hotspot will will thereby be more kind to an already depleted resource, reduce stress on the kernel and become more robust on systems under high load.
> 
> The proposed modifications to `os_linux.cpp` have substantially improved system stability in a mid-sized Jenkins cluster and have been in production within our systems over the past three years. I have verbatim ported these to the other platforms, which previously also relied on identical logic.

This pull request has now been integrated.

Changeset: 27a42435
Author:    Yannik Stradmann <yjs at stradmann.name>
Committer: David Holmes <dholmes at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/27a4243561e31d6f2858dd0c0bd356e2849ed87c
Stats:     68 lines in 4 files changed: 56 ins; 0 del; 12 mod

8354560: Exponentially delay subsequent native thread creation in case of EAGAIN

Reviewed-by: dholmes, fbredberg

-------------

PR: https://git.openjdk.org/jdk/pull/24682


More information about the hotspot-runtime-dev mailing list