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

8294751: Zero: Allow larger default heaps #10552

Closed

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Oct 4, 2022

Zero is currently defaulting to MaxRAM=1G on all machines. It is set in compiler_globals.pd under #if !defined(COMPILER1) && !defined(COMPILER2) && !INCLUDE_JVMCI.

Zero supports lots of GCs, and there is little sense to penalize it unnecessarily with too small heaps. After JDK-8292847, this would allow G1 with reasonable heap size on most machines.

Motivational improvements, SPECjvm2008:serial:

# Baseline, G1
Serial.test  thrpt   10  1619.863 ± 16.694  ops/s

# Baseline, Serial
Serial.test  thrpt   10  1094.438 ± 20.425  ops/s

# Patched, G1
Serial.test  thrpt   10  1623.090 ± 17.553  ops/s

# Patched, Serial
Serial.test  thrpt   10  1624.531 ± 15.792  ops/s  ; <---- matches G1 now, because young is not tiny

Before:

$ build/linux-x86_64-zero-release/jdk/bin/java -Xlog:gc -Xlog:gc+init Alloc.java
[0.003s][info][gc     ] Using G1
...
[0.005s][info][gc,init] Memory: 125G
...
[0.005s][info][gc,init] Heap Region Size: 1M
[0.005s][info][gc,init] Heap Min Capacity: 8M
[0.005s][info][gc,init] Heap Initial Capacity: 16M
[0.005s][info][gc,init] Heap Max Capacity: 256M

After:

$ build/linux-x86_64-zero-release/jdk/bin/java -Xlog:gc -Xlog:gc+init Alloc.java
[0.003s][info][gc     ] Using G1
...
[0.007s][info][gc,init] Memory: 125G
...
[0.007s][info][gc,init] Heap Region Size: 16M
[0.007s][info][gc,init] Heap Min Capacity: 16M
[0.007s][info][gc,init] Heap Initial Capacity: 2016M
[0.007s][info][gc,init] Heap Max Capacity: 30208M

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

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10552

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 4, 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 Oct 4, 2022
@openjdk
Copy link

openjdk bot commented Oct 4, 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 Oct 4, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 4, 2022

Webrevs

@iklam
Copy link
Member

iklam commented Oct 5, 2022

Do we need to overhaul the other combinations as well? I don't see why we have to artificially limit the heap sizes. Here's the pd value for MaxRAM, which is defined identically for all platforms:

  • no C2 = 1GB
  • C2 on 32-bit = 4GB
  • C2 on 64-bit = 128 GB

Also, if you want to do it for only ZERO for now, I think it's better to set the value inside compiler_globals_pd.hpp

#ifdef ZERO
define_pd_global(uint64_t,MaxRAM,                    128ULL*G);
#else 
define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
#endif

@shipilev
Copy link
Member Author

shipilev commented Oct 6, 2022

Do we need to overhaul the other combinations as well? I don't see why we have to artificially limit the heap sizes.

Probably. But as always with ergonomics, it might have unintended consequences.

Also, if you want to do it for only ZERO for now, I think it's better to set the value inside compiler_globals_pd.hpp

Yeah, @tstuefe asked about this in the previous PR too. Let's move both flags to that .hpp then. See new commit.

@openjdk
Copy link

openjdk bot commented Oct 6, 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:

8294751: Zero: Allow larger default heaps

Reviewed-by: iklam, rkennke

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

  • 33d0618: 6616245: NullPointerException when using JFileChooser with a custom FileView
  • fba763f: 8291519: jdk/jfr/api/event/TestShouldCommit.java failed with Unexpected value of shouldCommit()
  • 6053bf0: 8293782: Shenandoah: some tests failed on lock rank check
  • 4435d56: 8282395: URL.openConnection can throw IOOBE
  • fe70487: 8294958: java/net/httpclient/ConnectTimeout tests are slow
  • 97f1321: 8294356: IGV: scheduled graphs contain duplicated elements
  • 5e05e42: 8294901: remove pre-VS2017 checks in Windows related coding
  • e775acf: 8293986: Incorrect double-checked locking in com.sun.beans.introspect.ClassInfo
  • 9d116ec: 8294262: AArch64: compiler/vectorapi/TestReverseByteTransforms.java test failed on SVE machine
  • 4b17d28: 8294261: AArch64: Use pReg instead of pRegGov when possible
  • ... and 38 more: https://git.openjdk.org/jdk/compare/2ceebf681ffd6f9bf6967fd81b30d721bc010b94...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 Oct 6, 2022
@shipilev
Copy link
Member Author

GHA re-run returned green. Yet, this PR checks report some failures. This is an infrastructure hiccup.

@tstuefe, the move of these checks to header definitions -- that is what you wanted to see, right?

Copy link
Contributor

@rkennke rkennke 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 and patch looks good!

Thanks,
Roman

@shipilev
Copy link
Member Author

Thanks!

/integrate

@openjdk
Copy link

openjdk bot commented Oct 11, 2022

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

  • 33d0618: 6616245: NullPointerException when using JFileChooser with a custom FileView
  • fba763f: 8291519: jdk/jfr/api/event/TestShouldCommit.java failed with Unexpected value of shouldCommit()
  • 6053bf0: 8293782: Shenandoah: some tests failed on lock rank check
  • 4435d56: 8282395: URL.openConnection can throw IOOBE
  • fe70487: 8294958: java/net/httpclient/ConnectTimeout tests are slow
  • 97f1321: 8294356: IGV: scheduled graphs contain duplicated elements
  • 5e05e42: 8294901: remove pre-VS2017 checks in Windows related coding
  • e775acf: 8293986: Incorrect double-checked locking in com.sun.beans.introspect.ClassInfo
  • 9d116ec: 8294262: AArch64: compiler/vectorapi/TestReverseByteTransforms.java test failed on SVE machine
  • 4b17d28: 8294261: AArch64: Use pReg instead of pRegGov when possible
  • ... and 38 more: https://git.openjdk.org/jdk/compare/2ceebf681ffd6f9bf6967fd81b30d721bc010b94...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 11, 2022

@shipilev Pushed as commit 3ebe5ad.

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

@shipilev shipilev deleted the JDK-8294751-zero-larger-heaps branch October 21, 2022 09:48
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