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

8332514: Allow class space size to be larger than 3GB #19347

Conversation

tstuefe
Copy link
Member

@tstuefe tstuefe commented May 22, 2024

Class space size is capped at 3GB. Technically, the Klass encoding range is 4GB.

We cap class space at 3GB to leave breathing room for CDS. However, CDS needs a lot less, so we waste address space. In addition, class space is unnecessarily capped at 3GB even if we run without CDS, which is unnecessary.

What we should do instead:

  • if CDS is off, use the full 4GB
  • if CDS is on, use as much memory as we can after accommodating the archive

This patch implements that new behavior.

Now, we can have 4GB class space without CDS; with CDS, a bit less (depends on the CDS archive size; by default, on MacOS, we reach about 3.98GB).


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-8332514: Allow class space size to be larger than 3GB (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19347

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 22, 2024

👋 Welcome back stuefe! 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 May 22, 2024

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

8332514: Allow class space size to be larger than 3GB

Reviewed-by: iklam, dholmes

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

  • 91101f0: 8333353: Delete extra empty line in CodeBlob.java
  • e0ac824: 8332959: C2: ZGC fails with 'Incorrect load shift' when invoking Object.clone() reflectively on an array
  • d2d78ad: 8280990: [XWayland] XTest emulated mouse click does not bring window to front
  • 7c83d7a: 8333366: C2: CmpU3Nodes are not pushed back to worklist in PhaseCCP leading to non-fixpoint assertion failure
  • 75220da: 8333154: RISC-V: Add support for primitive array C1 clone intrinsic
  • a4c7be8: 8333006: RISC-V: C2: Support vector-scalar and vector-immediate arithmetic instructions
  • cfe91ed: 8333276: RISC-V: client VM build failure after JDK-8241503
  • 769b3e4: 8333182: Add truncated tracing mode for TraceBytecodes
  • 8338946: 8332935: Crash: assert(*lastPtr != 0) failed: Mismatched JNINativeInterface tables, check for new entries
  • 4785461: 7022325: TEST_BUG: test/java/util/zip/ZipFile/ReadLongZipFileName.java leaks files if it fails
  • ... and 108 more: https://git.openjdk.org/jdk/compare/97ee2ffb89257a37a178b70c8fee96a1d831deb6...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 changed the title JDK-8332514: Allow class space size to be larger than 3GB if possible 8332514: Allow class space size to be larger than 3GB if possible May 22, 2024
@openjdk
Copy link

openjdk bot commented May 22, 2024

@tstuefe 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 May 22, 2024
@tstuefe tstuefe force-pushed the JDK-8332514-Allow-class-space-size-to-be-larger-than-3GB-if-possible branch from 7cf5848 to ba013f2 Compare May 22, 2024 17:38
@tstuefe tstuefe changed the title 8332514: Allow class space size to be larger than 3GB if possible 8332514: Allow class space size to be larger than 3GB May 23, 2024
@tstuefe
Copy link
Member Author

tstuefe commented May 23, 2024

Pinging @iklam. And @coleenp, maybe?

@tstuefe tstuefe marked this pull request as ready for review May 23, 2024 15:38
@openjdk openjdk bot added the rfr Pull request is ready for review label May 23, 2024
@mlbridge
Copy link

mlbridge bot commented May 23, 2024

Webrevs

@tstuefe
Copy link
Member Author

tstuefe commented May 27, 2024

@iklam Thanks for the review.

  • I replaced the offending assert with one requiring archive size to be smaller than 4G - 16MB, for a theoretical minimal class space size of 16MB.
  • I rewrote the test. I split it into several independently executed parts, and only the part doing the dumping requires CDS. I also explicitly dump now, with an explicitly given archive.

Copy link
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for making the changes.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 28, 2024
@tstuefe
Copy link
Member Author

tstuefe commented May 28, 2024

Thanks @iklam !

@rkennke could you take a look please? Its simple.

@tstuefe
Copy link
Member Author

tstuefe commented May 31, 2024

Anyone else? I would like to get this into 23, and the patch is not complex. Thanks!

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.

Seems reasonable. Thanks.

@tstuefe
Copy link
Member Author

tstuefe commented Jun 3, 2024

Many thanks, @dholmes-ora and @iklam !

/integrate

@openjdk
Copy link

openjdk bot commented Jun 3, 2024

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

  • 5ed0d52: 8332936: Test vmTestbase/metaspace/gc/watermark_70_80/TestDescription.java fails with no GC's recorded
  • 91101f0: 8333353: Delete extra empty line in CodeBlob.java
  • e0ac824: 8332959: C2: ZGC fails with 'Incorrect load shift' when invoking Object.clone() reflectively on an array
  • d2d78ad: 8280990: [XWayland] XTest emulated mouse click does not bring window to front
  • 7c83d7a: 8333366: C2: CmpU3Nodes are not pushed back to worklist in PhaseCCP leading to non-fixpoint assertion failure
  • 75220da: 8333154: RISC-V: Add support for primitive array C1 clone intrinsic
  • a4c7be8: 8333006: RISC-V: C2: Support vector-scalar and vector-immediate arithmetic instructions
  • cfe91ed: 8333276: RISC-V: client VM build failure after JDK-8241503
  • 769b3e4: 8333182: Add truncated tracing mode for TraceBytecodes
  • 8338946: 8332935: Crash: assert(*lastPtr != 0) failed: Mismatched JNINativeInterface tables, check for new entries
  • ... and 109 more: https://git.openjdk.org/jdk/compare/97ee2ffb89257a37a178b70c8fee96a1d831deb6...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 3, 2024

@tstuefe Pushed as commit b101586.

💡 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
Development

Successfully merging this pull request may close these issues.

3 participants