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

8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening #5775

Closed

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Sep 30, 2021

This reliably fails with Serial (ignored by @requires), Shenandoah and Z:

$ CONF=linux-x86_64-server-fastdebug make run-test TEST=jdk/jfr/event/oldobject/TestClassLoaderLeak.java TEST_VM_OPTS="-XX:+UseShenandoahGC"

...

STDERR:
java.lang.RuntimeException: Could not find class leak
at jdk.test.lib.Asserts.fail(Asserts.java:594)
at jdk.jfr.event.oldobject.TestClassLoaderLeak.main(TestClassLoaderLeak.java:80)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
at java.base/java.lang.Thread.run(Thread.java:833)

I believe this test implicitly wants at least one GC cycle to happen so that ObjectSampler::oop_storage_gc_notification turns the sampled objects "old". An easy way to do this is to trim the Java heap size. If that does not work, we would need to go to MXBeans and watch GC cycles happening.

Additional testing:

  • Affected test with -XX:+UseShenandoahGC, 10 times
  • Affected test with -XX:+UseZGC, 10 times
  • Affected test with -XX:+UseSerialGC, 10 times
  • Affected test with -XX:+UseParallelGC, 10 times
  • Affected test with -XX:+UseG1GC, 10 times

Progress

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

Issue

  • JDK-8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5775/head:pull/5775
$ git checkout pull/5775

Update a local copy of the PR:
$ git checkout pull/5775
$ git pull https://git.openjdk.java.net/jdk pull/5775/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5775

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5775.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 30, 2021

👋 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
Copy link

openjdk bot commented Sep 30, 2021

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

  • hotspot-jfr

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-jfr hotspot-jfr-dev@openjdk.org label Sep 30, 2021
@shipilev shipilev marked this pull request as ready for review September 30, 2021 12:09
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 30, 2021
@mlbridge
Copy link

mlbridge bot commented Sep 30, 2021

Webrevs

@SGanguly1999
Copy link

SGanguly1999 commented Sep 30, 2021

Extremely sorry to interrupt here...But could you please tell me why we cannot call Thread.start() for the same instance of thread. I actually googled it but haven't got a satisfactory answer.
Please help me out

@shipilev
Copy link
Member Author

Extremely sorry to interrupt here...But could you please tell me why we cannot call Thread.start() for the same instance of thread. I actually googled it but haven't got a satisfactory answer. Please help me out

Unfortunately, the OpenJDK PR comment, especially in the unrelated PR, is not a good place to seek general Java help. Please ask elsewhere, for example on StackOverflow.

@openjdk
Copy link

openjdk bot commented Sep 30, 2021

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

8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening

Reviewed-by: egahlin

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

  • 9573022: 8253197: vmTestbase/nsk/jvmti/StopThread/stopthrd007/TestDescription.java fails with "ERROR: DebuggeeSleepingThread: ThreadDeath lost"
  • f08180f: 8274501: c2i entry barriers read int as long on AArch64
  • c57ed22: 8274528: Add comment to explain an HKDF optimization in SSLSecretDerivation
  • 9180d9a: 8273216: JCMD does not work across container boundaries with Podman
  • 3e0d7c3: 8270290: NTLM authentication fails if HEAD request is used
  • bfd6163: 8274196: Crashes in VM_HeapDumper::work after JDK-8252842
  • bb95dda: 8248001: javadoc generates invalid HTML pages whose ftp:// links are broken
  • 2f955d6: 8273142: Remove dependancy of TestHttpServer, HttpTransaction, HttpCallback from open/test/jdk/sun/net/www/protocol/http/ tests
  • 94e31e5: 8274506: TestPids.java and TestPidsLimit.java fail with podman run as root
  • a8210c5: 8274401: C2: GraphKit::load_array_element bypasses Access API
  • ... and 29 more: https://git.openjdk.java.net/jdk/compare/79865cd797737f22cd4efe7e9c03ddbb86095e64...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 Sep 30, 2021
@shipilev
Copy link
Member Author

shipilev commented Oct 4, 2021

Thanks @egahlin!

/integrate

@openjdk
Copy link

openjdk bot commented Oct 4, 2021

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

  • 0828273: 8274521: jdk/jfr/event/gc/detailed/TestGCLockerEvent.java fails when other GC is selected
  • 6726c59: 8274634: Use String.equals instead of String.compareTo in java.desktop
  • 3281102: 8268084: [macos] Disabled JMenuItem arrow is not disabled
  • 7957994: 8273695: Safepoint deadlock on VMOperation_lock
  • 9ca6bf0: 8274505: Too weak variable type leads to unnecessary cast in java.desktop
  • 0786d8b: 8268435: (ch) ChannelInputStream could override readAllBytes
  • bb4500d: 8274465: Fix javax/swing/text/ParagraphView/6364882/bug6364882.java failures
  • 05d3860: 8274605: Fix predicate guarantees on returned values in (Doc)SourcePositions
  • 3d7671b: 8274562: (fs) UserDefinedFileAttributeView doesn't correctly determine if supported when using OverlayFS
  • c05dc26: 8274435: EXCEPTION_ACCESS_VIOLATION in BFSClosure::closure_impl
  • ... and 48 more: https://git.openjdk.java.net/jdk/compare/79865cd797737f22cd4efe7e9c03ddbb86095e64...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 4, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 4, 2021
@openjdk
Copy link

openjdk bot commented Oct 4, 2021

@shipilev Pushed as commit 47bfc8a.

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

@shipilev shipilev deleted the JDK-8274563-jfr-classloader-leak branch October 11, 2021 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-jfr hotspot-jfr-dev@openjdk.org integrated Pull request has been integrated
3 participants