> This is a test bug. The gets the first region, gets top() for the that > region, and then uses that top() address to get the region that top() is in. > It expects it to be the same region. However, when the region is full, top() > is actually the next address beyond the end of the region, so marks the start > of the next region. The fix is to simply subtract 1 from top() when it equals > end(). Note top() is where the next allocation comes from in the region and > end() is the end of region space. > > I improved the test by adding printing of the G1 heap, including all regions. > I also improved the test by making it test every region, not just the first > one. During local testing the first region was always free, so did not make > for a very good test, and would not reproduce the issue. When I started > testing every region, it failed every time. All you need is one full region > for failures. > > I ran the test 100 times on all supported platforms. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
Chris Plummer has updated the pull request incrementally with one additional commit since the last revision: get rid of unneeded module ------------- Changes: - all: https://git.openjdk.org/jdk/pull/31469/files - new: https://git.openjdk.org/jdk/pull/31469/files/3d9adb41..70e9387e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=31469&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=31469&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 2 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/31469.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/31469/head:pull/31469 PR: https://git.openjdk.org/jdk/pull/31469
