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

JDK-8271242: add arena regression tests #4898



Copy link

@tstuefe tstuefe commented Jul 24, 2021


May I have reviews for these new regression tests for hotspot arenas, please? Arena coding is fragile, and recently we have changed it and plan to change it some more. But we have no tests, so regression tests should exist.

This is a breakout from #4784. In which I rewrote arena alignment handling and added a lot of tests. The arena changes were rejected as too complex, which is okay, but most of the tests are still good and I hope not controversial. Therefore I would like the tests to the gtest suite.

This patch adds test, but does not change the Arenas themselves. Instead it tests current behavior, taking it as a baseline. Where the current behavior is inconsistent (eg. when dealing with 0-sized allocations), it nevertheless tests the inconsistent behavior, since callers may rely on it.

This patch also adds a new jtreg gtest wrapper which tests the arena-releated part of the tests with +UseMallocOnly. As long as we support that mode, we should test it.


  • manual on Linux x64 and x86 both, with and without UseMallocOnly.
  • GHAs
  • nightlies at SAP are scheduled.

Note: this needs JDK-8270308, which is not yet pushed but under review here: #4835.


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



Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4898

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

Using diff file

Download this PR as a diff file:

@@ -134,6 +134,15 @@ class Arena : public CHeapObj<mtNone> {
void* Amalloc(size_t x, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
x = ARENA_ALIGN(x); // note for 32 bits this should align _hwm as well.
debug_only(if (UseMallocOnly) return malloc(x);)
// JDK-8270308: Amalloc guarantees 64-bit alignment and we need to ensure that in case the preceding
Copy link
Member Author

@tstuefe tstuefe Jul 24, 2021

Choose a reason for hiding this comment

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

Please ignore, this belongs to JDK-8270308 which is waiting for final approval (#4835). Will be removed before pushing.

Copy link

@bridgekeeper bridgekeeper bot commented Jul 24, 2021

👋 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.

Copy link

@openjdk openjdk bot commented Jul 24, 2021

@tstuefe 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 Jul 24, 2021
@tstuefe tstuefe changed the title Jdk 8271242 add arena regression tests JDK-8271242: add arena regression tests Jul 24, 2021
@tstuefe tstuefe marked this pull request as ready for review Jul 24, 2021
@openjdk openjdk bot added the rfr label Jul 24, 2021
Copy link

@mlbridge mlbridge bot commented Jul 24, 2021


@tstuefe tstuefe marked this pull request as draft Jul 25, 2021
@openjdk openjdk bot removed the rfr label Jul 25, 2021
@tstuefe tstuefe closed this Jul 26, 2021
@tstuefe tstuefe deleted the JDK-8271242-add-arena-regression-tests branch Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant