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

8261551: Remove special CDS handling in Metaspace::allocate #3185

Closed

Conversation

iklam
Copy link
Member

@iklam iklam commented Mar 25, 2021

Please review this simple patch to remove the special handling of OOM conditions inside Metaspace::allocate() for CDS archive dumping. Now the OOM exception will be thrown normally and will be handled by MetaspaceShared::preload_and_dump() and ClassListParser::parse().


Progress

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

Issue

  • JDK-8261551: Remove special CDS handling in Metaspace::allocate

Reviewers

Download

To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3185/head:pull/3185
$ git checkout pull/3185

To update a local copy of the PR:
$ git checkout pull/3185
$ git pull https://git.openjdk.java.net/jdk pull/3185/head

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 25, 2021

👋 Welcome back iklam! 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
Copy link

openjdk bot commented Mar 25, 2021

@iklam 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 Mar 25, 2021
@iklam iklam force-pushed the 8261551-remove-cds-handling-in-metaspace branch 2 times, most recently from e719f37 to 5708f5e Compare Mar 25, 2021
@iklam iklam marked this pull request as ready for review Mar 25, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 25, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 25, 2021

Webrevs

yminqi
yminqi approved these changes Mar 25, 2021
Copy link
Contributor

@yminqi yminqi left a comment

LGTM.

@openjdk
Copy link

openjdk bot commented Mar 25, 2021

@iklam 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:

8261551: Remove special CDS handling in Metaspace::allocate

Reviewed-by: minqi, dholmes, stuefe

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

  • 4e708e5: 8260862: JFR: New configure command for the jfr tool
  • 2593196: 8264161: BigDecimal#stripTrailingZeros can throw undocumented ArithmeticException
  • 2a5e0dd: 8262081: vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001/TestDescription.java failed with "ERROR: eventSet1.size() != 3 :: 2"
  • 374272f: 8261502: ECDHKeyAgreement: Allows alternate ECPrivateKey impl and revised exception handling
  • dbc9e4b: 8253795: Implementation of JEP 391: macOS/AArch64 Port
  • b006f22: 4833719: (bf) Views of MappedByteBuffers are not MappedByteBuffers, and cannot be forced
  • 8307aa6: 8264165: jpackage BasicTest fails after JDK-8220266: Check help text contains plaform specific parameters
  • c037e1e: 8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim()
  • a1e717f: 8264146: Make Mutex point to rather than embed _name
  • f69afba: 8263300: add HtmlId for the block containing a class's description.
  • ... and 12 more: https://git.openjdk.java.net/jdk/compare/cfc9aa34fdf5f7844e4b77e7be34d5455f63ae4a...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 Mar 25, 2021
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Hi Ioi,

This seems fine. But I noticed that preload_and_dump doesn't let exceptions escape so should not itself be a TRAPS method (and it can be called with main_thread rather than THREAD).

Thanks,
David

Copy link
Member

@tstuefe tstuefe left a comment

+1. Nice to see this gone.

@iklam
Copy link
Member Author

iklam commented Mar 25, 2021

Hi Ioi,

This seems fine. But I noticed that preload_and_dump doesn't let exceptions escape so should not itself be a TRAPS method (and it can be called with main_thread rather than THREAD).

Thanks,
David

Thanks for noticing. I removed TRAPS from MetaspaceShared::preload_and_dump() in the updated version, since it's somewhat related to this issue.

@@ -612,7 +612,8 @@ void MetaspaceShared::prepare_for_dumping() {

// Preload classes from a list, populate the shared spaces and dump to a
// file.
void MetaspaceShared::preload_and_dump(TRAPS) {
void MetaspaceShared::preload_and_dump() {
Copy link
Member

@dholmes-ora dholmes-ora Mar 26, 2021

Choose a reason for hiding this comment

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

I would have kept the Thread argument to avoid the implicit Thread::current() in EXCEPTION_MARK. But it is a margin call either way.

@iklam
Copy link
Member Author

iklam commented Mar 26, 2021

Thanks @tstuefe @dholmes-ora @yminqi for the review.
/integrate

@openjdk openjdk bot closed this Mar 26, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 26, 2021
@openjdk
Copy link

openjdk bot commented Mar 26, 2021

@iklam Since your change was applied there have been 23 commits pushed to the master branch:

  • fe8ef32: 8264151: ciMethod::ensure_method_data() should return false is loading resulted in empty state
  • 4e708e5: 8260862: JFR: New configure command for the jfr tool
  • 2593196: 8264161: BigDecimal#stripTrailingZeros can throw undocumented ArithmeticException
  • 2a5e0dd: 8262081: vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001/TestDescription.java failed with "ERROR: eventSet1.size() != 3 :: 2"
  • 374272f: 8261502: ECDHKeyAgreement: Allows alternate ECPrivateKey impl and revised exception handling
  • dbc9e4b: 8253795: Implementation of JEP 391: macOS/AArch64 Port
  • b006f22: 4833719: (bf) Views of MappedByteBuffers are not MappedByteBuffers, and cannot be forced
  • 8307aa6: 8264165: jpackage BasicTest fails after JDK-8220266: Check help text contains plaform specific parameters
  • c037e1e: 8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim()
  • a1e717f: 8264146: Make Mutex point to rather than embed _name
  • ... and 13 more: https://git.openjdk.java.net/jdk/compare/cfc9aa34fdf5f7844e4b77e7be34d5455f63ae4a...master

Your commit was automatically rebased without conflicts.

Pushed as commit 41657b1.

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

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
5 participants