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

8294589: MenuBarSkin: memory leak when changing skin #906

Conversation

andy-goryachev-oracle
Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle commented Sep 29, 2022

Fixed memory leak by using weak listeners and making sure to undo everything that has been done to MenuBar/Skin in dispose().

This PR depends on a new internal class ListenerHelper, a replacement for LambdaMultiplePropertyChangeListenerHandler.
See #908


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8294589: MenuBarSkin: memory leak when changing skin

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 906

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/906.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 29, 2022

👋 Welcome back angorya! 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.

@andy-goryachev-oracle andy-goryachev-oracle marked this pull request as ready for review October 3, 2022 21:36
@openjdk openjdk bot added the rfr Ready for review label Oct 3, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 3, 2022

@andy-goryachev-oracle
Copy link
Contributor Author

I have a string feeling that this PR should go back to DRAFT state, pending a better listener helper implementation JDK-8294809. Also, this particular skin may need to get it's listeners refactored - I see two scene listeners which seems redundant.

@andy-goryachev-oracle andy-goryachev-oracle marked this pull request as draft October 4, 2022 20:29
@openjdk openjdk bot removed the rfr Ready for review label Oct 4, 2022
@kleopatra
Copy link
Collaborator

I have a string feeling that this PR should go back to DRAFT state, pending a better listener helper implementation JDK-8294809. Also, this particular skin may need to get it's listeners refactored - I see two scene listeners which seems redundant.

don't worry: you choose one of the hardest skins to fix as your first - only the comboXX are worse ;)

  • it has OS-specifics
  • it needs listeners/handlers on the scene which are very tricky to get right on and off
  • it's unusual in not having a behavior (that's where the event handlers should reside)
  • it has nested menus (which are problematic in themselves)
  • .. probably more :)

@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Oct 8, 2022

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Nov 30, 2022
@andy-goryachev-oracle
Copy link
Contributor Author

@hjohn : could you please take a look at this, since it had a non-trivial merge? thanks!

@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Nov 30, 2022

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@andy-goryachev-oracle andy-goryachev-oracle requested review from hjohn and removed request for aghaisas December 1, 2022 23:33
@andy-goryachev-oracle
Copy link
Contributor Author

@aghaisas : would you please take a look?

Copy link
Collaborator

@aghaisas aghaisas left a comment

Choose a reason for hiding this comment

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

Fix looks good to me!

@openjdk
Copy link

openjdk bot commented Dec 5, 2022

@andy-goryachev-oracle 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:

8294589: MenuBarSkin: memory leak when changing skin

Reviewed-by: aghaisas, jhendrikx

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

  • c2af0c3: 8238968: Inconsisent formatting of Rectangle2D toString method
  • fe81a27: 8287822: [macos] Remove support of duplicated formats from macOS
  • 9416874: 8297362: EOS might not be delivered by progressbuffer in some cases

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 Ready to be integrated label Dec 5, 2022
@andy-goryachev-oracle
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Dec 5, 2022

Going to push as commit 2c18c18.
Since your change was applied there have been 3 commits pushed to the master branch:

  • c2af0c3: 8238968: Inconsisent formatting of Rectangle2D toString method
  • fe81a27: 8287822: [macos] Remove support of duplicated formats from macOS
  • 9416874: 8297362: EOS might not be delivered by progressbuffer in some cases

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 5, 2022
@openjdk openjdk bot closed this Dec 5, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Dec 5, 2022
@openjdk
Copy link

openjdk bot commented Dec 5, 2022

@andy-goryachev-oracle Pushed as commit 2c18c18.

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

@andy-goryachev-oracle andy-goryachev-oracle deleted the 8294589.menubarskin.leak branch December 5, 2022 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

6 participants