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
8264677 MemoryLeak: Progressindicator leaks, when treeShowing is false #455
8264677 MemoryLeak: Progressindicator leaks, when treeShowing is false #455
Conversation
👋 Welcome back fkirmaier! A progress list of the required criteria for merging this PR into |
Webrevs
|
/reviewers 2 |
@kevinrushforth |
Is this a recent regression, or has this case been failing for a long time? |
I think it's failing since a long time. But i haven't tested it. |
Before, ProgressIndicator was basically leaking every time, this is a very rare special case. |
I see. Thanks. /reviewers 2 |
@kevinrushforth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't run it yet, but noticed a couple things during a quick code review.
modules/javafx.controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java
Show resolved
Hide resolved
I've done the 2 changes from the code review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested a minor change.
The test file has an existing test memoryTest()
. The AfterClass
and BeforeClass
methods are specific to this test, and not related to the new test. It looks little unstructured with addition of this new test. Not sure if it is worth to change the helper methods and existing test.
otherwise the fix and test looks good.
tests/system/src/test/java/test/javafx/scene/control/ProgressIndicatorLeakTest.java
Outdated
Show resolved
Hide resolved
I've now reworked the old test. The initialization of JavaFX is now seperated of the old test. |
Also no longer WeakReferences are needed for the test due to the new memory tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks good. So does the newly added test, and I like the refactoring of the tests that you've done. I left one question about existing test.
indicator.setProgress(-1.0); | ||
indicator.setProgress(1.0); | ||
checker.assertCollectable(detIndicator); | ||
stage.show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you are no longer waiting for Stage::onShown
, isn't it possible for the test to miss a potential leak? Can you explain why you think it's not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question.
OnShown is usually called in about 1 Frame.
The memory-leak test takes some times, usually longer as 1 Frame.
In the current configuration, it takes up to 1 seconds, with up to 10 checks.
Because the check is so much longer, waiting for onShown doesn't really make a difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My worry isn't the test might fail and give a false positive. The checking 10 times will be sufficient for that.
My concern is that since this bug fix is fixing a leak that only happens when the stage is showing, the test might miss a potential leak if a regression in this area were ever reintroduced. I think it's best to restore the wait for onShown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've readded the wait onShown. I don't really see a Scenario were this makes a difference, but i guess it's more correct, because it now tests it at the moment, where the object should be free, and not relying on the fact, that the check takes some time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks good now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me.
@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:
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 35 new commits pushed to the
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 (@kevinrushforth, @arapte) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@FlorianKirmaier |
/sponsor |
@kevinrushforth @FlorianKirmaier Since your change was applied there have been 35 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 483f171. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Fixing leak in ProgressIndicator when treeShowing is false
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/455/head:pull/455
$ git checkout pull/455
Update a local copy of the PR:
$ git checkout pull/455
$ git pull https://git.openjdk.java.net/jfx pull/455/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 455
View PR using the GUI difftool:
$ git pr show -t 455
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/455.diff