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

8279228 Leak in ScrollPaneSkin, related to touch events #701

Conversation

FlorianKirmaier
Copy link
Member

@FlorianKirmaier FlorianKirmaier commented Dec 23, 2021

Fixing memoryleak, related to touch events in ScrollPaneWhen touchDetected or mouseDown is true, the sbTouch animation is running,
and the node is removed from the Scene, then the animation will never stop, causing a memory leak.
A simple fix is to also check, whether the Node is visible, by checking the "isTreeShowing" property.


Progress

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

Issue

  • JDK-8279228: Leak in ScrollPaneSkin, related to touch events

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 701

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

Using diff file

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

Fixing memoryleak, related to touch events in ScrollPane
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 23, 2021

👋 Welcome back fkirmaier! 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 openjdk bot added the rfr Ready for review label Dec 23, 2021
@mlbridge
Copy link

mlbridge bot commented Dec 23, 2021

Webrevs

@kevinrushforth
Copy link
Member

kevinrushforth commented Jan 6, 2022

Two quick questions:

  1. The fix checks whether or not the node is treeShowing at the time the startSBReleasedAnimation method is called. Is this sufficient? If a node's tree showing state changes, is it guaranteed that this method will be called?
  2. Can you provide an automated test for this?

/reviewers 2

@openjdk
Copy link

openjdk bot commented Jan 6, 2022

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@FlorianKirmaier
Copy link
Member Author

1.)
It's not only called at the beginning of the startSBReleasedAnimation, but whenever the animation is repeated, which is the cause for the leak. It happens when touchDetected == true || mouseDown == true is true. The animation is then basically restarted every frame. With my change, it also checks whether the node is still visible, which fixes the problem.

2.)
It's probably possible if there is a way to simulate Touch Events. The Robot doesn't seem to support it. A test would also require a way to set the "IS_TOUCH_SUPPORTED" property.
Honestly, I don't think it's a good time investment, because the fix is quite simple. I don't even know exactly when it happens - I've just made sure it no longer loops the animation when the ScrollPane is no longer visible.

I've also applied the fix in an affected application, and it clearly fixes the problem.

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.

This simple fix looks good to me.

@openjdk
Copy link

openjdk bot commented Feb 23, 2022

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

8279228: Leak in ScrollPaneSkin, related to touch events

Reviewed-by: aghaisas, kcr

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 44 new commits pushed to 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@aghaisas, @kevinrushforth) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Ready to be integrated label Feb 23, 2022
@FlorianKirmaier
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Feb 23, 2022
@openjdk
Copy link

openjdk bot commented Feb 23, 2022

@FlorianKirmaier
Your change (at version b9a6594) is now ready to be sponsored by a Committer.

@kevinrushforth
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Feb 23, 2022

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 23, 2022

@kevinrushforth @FlorianKirmaier Pushed as commit adf1da4.

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

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
3 participants