Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8274136: -XX:+ExitOnOutOfMemoryError calls exit while threads are running #5668

wants to merge 1 commit into from


Copy link

@dholmes-ora dholmes-ora commented Sep 23, 2021

Please see bug report for more detailed discussion.

We introduce os::_exit() to call _exit() to allow us to terminate without running the at_exit handlers and global destructors, which lead to the crashes during termination.

Testing: tiers 1-3 (includes the ExitOnOutOfMemoryError test)



  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed


  • JDK-8274136: -XX:+ExitOnOutOfMemoryError calls exit while threads are running



Using git

Checkout this PR locally:
$ git fetch pull/5668/head:pull/5668
$ git checkout pull/5668

Update a local copy of the PR:
$ git checkout pull/5668
$ git pull pull/5668/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5668

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

Using diff file

Download this PR as a diff file:

Copy link

@bridgekeeper bridgekeeper bot commented Sep 23, 2021

👋 Welcome back dholmes! 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 label Sep 23, 2021
Copy link

@openjdk openjdk bot commented Sep 23, 2021

@dholmes-ora The following label will be automatically applied to this pull request:

  • hotspot

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 label Sep 23, 2021
Copy link

@mlbridge mlbridge bot commented Sep 23, 2021


Copy link

@tstuefe tstuefe left a comment


Your assumption that -XX:+ExitOnOutOfMemoryError should stop the VM painlessly is what I think too. Our customers use it in scenarios where the VM should go down, quickly, with a minimum of fuzz. E.g. in cloud scenarios, where you want to restart the VM as fast as possible. OTOH, -XX:+CrashOnOutOfMemoryError should give you a hs-err file and a core, creating either may hang or at least delay matters.

Incidentally, in our SapMachine we added some subtle behavioral changes (, see italics). I know we talked about handling Thread exhaustion events, but what about simple stack printing to stdout, do you think that would be useful upstream?

Copy link

@openjdk openjdk bot commented Sep 24, 2021

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

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

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

8274136: -XX:+ExitOnOutOfMemoryError calls exit while threads are running

Reviewed-by: stuefe, hseigel

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 7 new commits pushed to the master branch:

  • 5ba0d09: 8274205: Handle KDC_ERR_SVC_UNAVAILABLE error code from KDC
  • 5a12af7: 8271880: Tighten condition for excluding regions from collecting cards with cross-references
  • db23ecd: 8274191: Improve g1 evacuation failure injector performance
  • d91e227: 8238274: (sctp) JDK-7118373 is not fixed for SctpChannel
  • 971aa35: 8274083: Update testing docs to mention tiered testing
  • 1d44014: 8273034: Make javadoc navigation collapsible on small displays
  • bb74ae8: 8274171: java/nio/file/Files/probeContentType/ failed on "Content type" mismatches

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 label Sep 24, 2021
Copy link

@hseigel hseigel left a comment

The changes look good. Thanks for fixing it.

Copy link
Member Author

@dholmes-ora dholmes-ora commented Sep 28, 2021

Thanks for the reviews @tstuefe and @hseigel.

@tstuefe : personally I don't think printing the stack to stdout is a necessary thing to add.


Copy link

@openjdk openjdk bot commented Sep 28, 2021

Going to push as commit 2657bcb.
Since your change was applied there have been 59 commits pushed to the master branch:

  • 53b25bc: 8273459: Update code segment alignment to 64 bytes
  • 1a29b1e: 8274016: Replace 'for' cycles with iterator with enhanced-for in java.desktop
  • d8a278f: 8274396: Suppress more warnings on non-serializable non-transient instance fields in client libs
  • e49e5b5: 8273972: Multi-core choke point in CMM engine (LCMSTransform.doTransform)
  • 2072bc7: 8274391: Suppress more warnings on non-serializable non-transient instance fields in java.util.concurrent
  • 6a477bd: 8274415: Suppress warnings on non-serializable non-transient instance fields in java.xml
  • 67e52a3: 8273634: [TEST_BUG] Improve javax/swing/text/ParagraphView/6364882/
  • b7425b6: 8239502: [TEST_BUG] Test javax/swing/text/FlowView/6318524/ never fails
  • c57a6c6: 8274265: Suspicious string concatenation in logTestUtils.inline.hpp
  • 6f4cefb: 8274394: Use Optional.isEmpty instead of !Optional.isPresent in jdk.jlink
  • ... and 49 more:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Sep 28, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Sep 28, 2021
Copy link

@openjdk openjdk bot commented Sep 28, 2021

@dholmes-ora Pushed as commit 2657bcb.

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

@dholmes-ora dholmes-ora deleted the 8274136 branch Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
hotspot integrated
3 participants