Skip to content

8381900: Test vmTestbase/nsk/jvmti/scenarios/allocation/AP03/ap03t001 does not handle frequent GC gracefully#30644

Open
jsikstro wants to merge 1 commit intoopenjdk:masterfrom
jsikstro:JDK-8381900_ap03t001_objectfree_ignore_at_end
Open

8381900: Test vmTestbase/nsk/jvmti/scenarios/allocation/AP03/ap03t001 does not handle frequent GC gracefully#30644
jsikstro wants to merge 1 commit intoopenjdk:masterfrom
jsikstro:JDK-8381900_ap03t001_objectfree_ignore_at_end

Conversation

@jsikstro
Copy link
Copy Markdown
Member

@jsikstro jsikstro commented Apr 9, 2026

Hello,

In the development of Automatic Heap Sizing (AHS) for ZGC we have seen vmTestbase/nsk/jvmti/scenarios/allocation/AP03/ap03t001 fail intermittently. The main thing in AHS affecting this test is the number of GCs being run. The ap03t001 test seems to not be able to reliably handle GC at any moment.

A naive solution to this problem is to just increase the min/initial heap size to give the test more headroom, but I think we should go with a more robust approach. What we're seeing in failing runs is that not only the "holder" object is beeing freed, but the test-object itself as well.

public static int run(String argv[], PrintStream out) {
    return new ap03t001().runThis(argv, out);
}

// ...

private int runThis(String argv[], PrintStream out) {
    // ...
    ap03t001 holder = new ap03t001();
    // ...
}

I propose we ignore ObjectFree events after having verified that the holder object has been resurrected into the catcher object, which is what this test is all about. Another alternative could be to disable ObjectFree events entirely after we're done, but I think this approach is easier to follow.

Testing:

  • Local testing with AHS, and in mainline, that this test passes when running a bunch of GC.

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-8381900: Test vmTestbase/nsk/jvmti/scenarios/allocation/AP03/ap03t001 does not handle frequent GC gracefully (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30644

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 9, 2026

👋 Welcome back jsikstro! 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
Copy Markdown

openjdk bot commented Apr 9, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the serviceability serviceability-dev@openjdk.org label Apr 9, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 9, 2026

@jsikstro The following label will be automatically applied to this pull request:

  • serviceability

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 rfr Pull request is ready for review label Apr 9, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 9, 2026

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfr Pull request is ready for review serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

1 participant