Skip to content

Conversation

@shipilev
Copy link
Member

@shipilev shipilev commented Sep 15, 2022

I am seeing this failure frequently on linux-x86:

$ CONF=linux-x86-server-fastdebug make test TEST=runtime/Thread/ThreadCountLimit.java
...
stdout:
[1.852s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 320k, guardsize: 0k, detached.
[1.852s][warning][os,thread] Failed to start the native thread for java.lang.Thread "Thread-8246"
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8388608 bytes for Failed to reserve memory for metaspace
# An error report file with more information is saved as:
# /home/shade/trunks/jdk/build/linux-x86-server-fastdebug/test-support/jtreg_test_hotspot_jtreg_runtime_Thread_ThreadCountLimit_java/scratch/0/hs_err_pid2107279.log
[2.019s][warning][os ] Loading hsdis library failed

It usually crashes when it tries to do heavy stuff in OutOfMemoryError block, which ends up either allocating the metadata for string concat method handles (the most frequent case), or allocating memory for resulting Strings. Sometimes even the threads themselves end up receiving a secondary OOM after main loop catches it.

I think we can strengthen this test significantly, by avoiding unnecessary things in dangerous loops.

Additionally, since the test can foobar the VM and/or experience heap memory runaway, it needs to run with othervm and fixed heap size.

After JDK-8255450, this test still runs in tier2.

Additional testing:

  • Linux x86_32 fastdebug, affected test in 100 repetitions (all passed!)
  • Linux x86_64 fastdebug, affected test in 100 repetitions

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8293872: Make runtime/Thread/ThreadCountLimit.java more robust

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10290/head:pull/10290
$ git checkout pull/10290

Update a local copy of the PR:
$ git checkout pull/10290
$ git pull https://git.openjdk.org/jdk pull/10290/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10290

View PR using the GUI difftool:
$ git pr show -t 10290

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10290.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 15, 2022

👋 Welcome back shade! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 15, 2022
@openjdk
Copy link

openjdk bot commented Sep 15, 2022

@shipilev The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Sep 15, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 15, 2022

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine. Thanks.

@openjdk
Copy link

openjdk bot commented Sep 21, 2022

@shipilev This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8293872: Make runtime/Thread/ThreadCountLimit.java more robust

Reviewed-by: dholmes, adinn

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 134 new commits pushed to the master branch:

  • 2be3158: 4797982: Setting negative size of JSplitPane divider leads to unexpected results.
  • 050eebf: 8294245: Make Compile::print_inlining_stream stack allocated
  • 91a23d7: 8294142: make test should report only on executed tests
  • 169a5d4: 8294193: Files.createDirectories throws FileAlreadyExistsException for a symbolic link whose target is an existing directory
  • 3675f4c: 8293252: Shenandoah: ThreadMXBean synchronizer tests crash with aggressive heuristics
  • 543851d: 8289607: Change hotspot/jtreg tests to not use Thread.suspend/resume
  • e2f8251: 8293618: x86: Wrong code generation in class Assembler
  • 6ecd081: 8294270: make test passes awkward -status:-status:error,fail to jtreg
  • eca9749: 8288325: [windows] Actual and Preferred Size of AWT Non-resizable frame are different
  • 2e20e7e: 8294271: Remove use of ThreadDeath from make utilities
  • ... and 124 more: https://git.openjdk.org/jdk/compare/7f3250d71c4866a64eb73f52140c669fe90f122f...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 21, 2022
@shipilev
Copy link
Member Author

This seems fine. Thanks.

Thanks! Can I have another review?

@shipilev
Copy link
Member Author

This seems fine. Thanks.

Thanks! Can I have another review?

Ping?

Copy link
Contributor

@adinn adinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@shipilev
Copy link
Member Author

Thank you!

/integrate

@openjdk
Copy link

openjdk bot commented Sep 26, 2022

Going to push as commit 36b61c5.
Since your change was applied there have been 134 commits pushed to the master branch:

  • 2be3158: 4797982: Setting negative size of JSplitPane divider leads to unexpected results.
  • 050eebf: 8294245: Make Compile::print_inlining_stream stack allocated
  • 91a23d7: 8294142: make test should report only on executed tests
  • 169a5d4: 8294193: Files.createDirectories throws FileAlreadyExistsException for a symbolic link whose target is an existing directory
  • 3675f4c: 8293252: Shenandoah: ThreadMXBean synchronizer tests crash with aggressive heuristics
  • 543851d: 8289607: Change hotspot/jtreg tests to not use Thread.suspend/resume
  • e2f8251: 8293618: x86: Wrong code generation in class Assembler
  • 6ecd081: 8294270: make test passes awkward -status:-status:error,fail to jtreg
  • eca9749: 8288325: [windows] Actual and Preferred Size of AWT Non-resizable frame are different
  • 2e20e7e: 8294271: Remove use of ThreadDeath from make utilities
  • ... and 124 more: https://git.openjdk.org/jdk/compare/7f3250d71c4866a64eb73f52140c669fe90f122f...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 26, 2022
@openjdk openjdk bot closed this Sep 26, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 26, 2022
@openjdk
Copy link

openjdk bot commented Sep 26, 2022

@shipilev Pushed as commit 36b61c5.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@shipilev shipilev deleted the JDK-8293872-thread-count-limit branch October 21, 2022 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants