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

8259627: Potential memory leaks in JVMTI after JDK-8227745 #2055

Conversation

reinrich
Copy link
Contributor

@reinrich reinrich commented Jan 12, 2021

This change eliminates memory leaks in the JVMTI implementation reported by SonarCloud.

The leaks occur when the Java heap is exhausted.


Progress

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

Issue

  • JDK-8259627: Potential memory leaks in JVMTI after JDK-8227745

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2055/head:pull/2055
$ git checkout pull/2055

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jan 12, 2021

👋 Welcome back rrich! 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 openjdk bot commented Jan 12, 2021

@reinrich The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added serviceability hotspot labels Jan 12, 2021
@reinrich reinrich marked this pull request as ready for review Jan 13, 2021
@openjdk openjdk bot added the rfr label Jan 13, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jan 13, 2021

Webrevs

Copy link
Contributor

@shipilev shipilev left a comment

This looks good to me, thanks!

@openjdk
Copy link

@openjdk openjdk bot commented Jan 13, 2021

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

8259627: Potential memory leaks in JVMTI after JDK-8227745

Reviewed-by: shade, stuefe, dholmes, sspitsyn

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

  • 2243a17: 8259485: Document need for short paths when building on Windows
  • 139b6da: 8259372: remove AIX related USE_LIBRARY_BASED_TLS_ONLY and THREAD_LOCAL special handling
  • a483869: 8225045: javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java fails on linux-x64
  • 44c8379: 8256019: JLabel HTML text does not support translucent text colors
  • 0957d9e: 8259519: The java.awt.datatransfer.DataFlavor#ioInputStreamClass field is redundant
  • 65bed64: 8253635: Implement toString() for SSLEngineImpl
  • c6d798c: 8259629: aarch64 builds fail after JDK-8258932
  • 4be2173: 8259319: Illegal package access when SunPKCS11 requires SunJCE's classes
  • e4df209: 7018932: Drawing very large coordinates with a dashed Stroke can cause Java to hang
  • 5f7ccce: 8226810: Failed to launch JVM because of NullPointerException occured on System.props
  • ... and 1 more: https://git.openjdk.java.net/jdk/compare/c338f1167f2ab0c1a35876419db914dce844d5e8...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 label Jan 13, 2021
@reinrich
Copy link
Contributor Author

@reinrich reinrich commented Jan 13, 2021

@shipilev thanks for doing the analysis and reporting the issues. I found 2 leaks. Do you see more that could be related to JDK-8227745 (40f847e2)?

I wanted to do a SonarCloud scan myself but was uncertain about the requested permissions, me using the service for work, etc. Would it be possible to publish the SC report?

@shipilev
Copy link
Contributor

@shipilev shipilev commented Jan 13, 2021

@shipilev thanks for doing the analysis and reporting the issues. I found 2 leaks. Do you see more that could be related to JDK-8227745 (40f847e)?

I wanted to do a SonarCloud scan myself but was uncertain about the requested permissions, me using the service for work, etc. Would it be possible to publish the SC report?

I think those are only two instances. I am only aware of this one. I meant to set up my own some time later.

Copy link
Member

@tstuefe tstuefe left a comment

Looks good.

@reinrich
Copy link
Contributor Author

@reinrich reinrich commented Jan 13, 2021

@shipilev thanks for doing the analysis and reporting the issues. I found 2 leaks. Do you see more that could be related to JDK-8227745 (40f847e)?
I wanted to do a SonarCloud scan myself but was uncertain about the requested permissions, me using the service for work, etc. Would it be possible to publish the SC report?

I think those are only two instances. I am only aware of this one. I meant to set up my own some time later.

Excellent! I googled for public scans but failed. Now I see that scans are listed on the "Explore" page of SonarCloud. Cool the tool found the leaks!

Thanks for the review also.

@reinrich
Copy link
Contributor Author

@reinrich reinrich commented Jan 13, 2021

Looks good.

Thanks for looking!

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Looks good!

Thanks,
David

Copy link
Contributor

@sspitsyn sspitsyn left a comment

Hi Richard,
LGTM++
Thanks,
Serguei

@reinrich
Copy link
Contributor Author

@reinrich reinrich commented Jan 13, 2021

Thanks for the reviews David and Serguei.

@reinrich
Copy link
Contributor Author

@reinrich reinrich commented Jan 15, 2021

/integrate

@openjdk openjdk bot closed this Jan 15, 2021
@openjdk openjdk bot added integrated and removed ready labels Jan 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 15, 2021

@reinrich Since your change was applied there have been 66 commits pushed to the master branch:

  • 2c8e337: 8259622: TreeMap.computeIfAbsent deviates from spec
  • d701bab: Merge
  • 4307fa6: 8253505: JFR: onFlush invoked out of order with a sorted event stream
  • 0148adf: 8255120: C2: assert(outer->outcnt() >= phis + 2 && outer->outcnt() <= phis + 2 + stores + 1) failed: only phis
  • 90960c5: 8252657: JVMTI agent is not unloaded when Agent_OnAttach is failed
  • e3b548a: 8257736: InputStream from BodyPublishers.ofInputStream() leaks when IOE happens
  • 978bed6: 8259522: Apply java.io.Serial annotations in java.desktop
  • bf28f92: 8259713: Fix comments about ResetNoHandleMark in deoptimization
  • 4f881ba: 8258652: Assert in JvmtiThreadState::cur_stack_depth() can noticeably slow down debugging single stepping
  • d18d26e: 8259350: Add some internal debugging APIs to the debug agent
  • ... and 56 more: https://git.openjdk.java.net/jdk/compare/c338f1167f2ab0c1a35876419db914dce844d5e8...master

Your commit was automatically rebased without conflicts.

Pushed as commit 6d4a593.

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

@openjdk openjdk bot removed the rfr label Jan 15, 2021
@reinrich reinrich deleted the 8259627_potential_memory_leaks_in_JVMTI branch Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot integrated serviceability
5 participants