Skip to content

8295809: TreeTableViewSkin: memory leak when changing skin #931

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

Conversation

andy-goryachev-oracle
Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle commented Oct 24, 2022

as determined by SkinMemoryLeakTest (remove line 180) and a leak tester
https://github.com/andy-goryachev-oracle/Test/blob/main/src/goryachev/apps/LeakTest.java

caused by:

  • adding and not removing listeners
  • adding and not removing event handlers/filters
  • adding and not removing cell factory
  • holding unnecessary instance in TreeTableViewSkin.treeTableViewSkin // test-only

NOTES:

  1. this fix requires JDK-8294809 ListenerHelper and JDK-8295806 TableViewSkin.
  2. there were more memory leaks in this skin than detected by SkinMemoryLeakTest, probably because of cell factory (?). A manual test using LeakTest shows that there are no memory leaks after a) replacing skin, b) moving the components to a new window, and c) removing all the components from the window.

Progress

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

Issue

  • JDK-8295809: TreeTableViewSkin: memory leak when changing skin

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 931

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 24, 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.

@openjdk
Copy link

openjdk bot commented Oct 24, 2022

⚠️ @andy-goryachev-oracle This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@andy-goryachev-oracle
Copy link
Contributor Author

must be reviewed after #929

@andy-goryachev-oracle andy-goryachev-oracle marked this pull request as ready for review December 5, 2022 17:07
@openjdk openjdk bot added the rfr Ready for review label Dec 5, 2022
@mlbridge
Copy link

mlbridge bot commented Dec 5, 2022

Webrevs

@andy-goryachev-oracle
Copy link
Contributor Author

@aghaisas could you please take a look at this PR?

@@ -232,10 +232,10 @@ public static Collection<Object[]> data() {
//MenuBar.class,

//
PasswordField.class,
//PasswordField.class,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems an unrelated change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since this is the last PR in the series of skin memory leak fixes, the code block will be removed.


//
Spinner.class,
Spinner.class
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems an unrelated change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cleaned up.

@@ -274,6 +274,8 @@ public void testTreeTableRowFixedCellSizeEnabled() {
assertTrue("fixed cell size enabled", isFixedCellSizeEnabled(tableRow));
}

@Ignore("JDK-8295809") // TODO probably need to verify the result of listener action,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to file a follow-on bug to modify or cleanup these ignored tests in future.
Use the bug ID of the newly filed bug with @Ignore tag for these two tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you for noticing! the tests are changed to validate functionality rather than implementation detail, i.e. that the tree table row skin tracks the virtual flow width with or without skin replacement.

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.

I have identified the minor changes required.

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.

Thanks for fixing the tests. Fix looks good now.

This will have some conflict with #805 fix though.

@openjdk
Copy link

openjdk bot commented Dec 8, 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:

8295809: TreeTableViewSkin: memory leak when changing skin

Reviewed-by: aghaisas

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 8, 2022
@andy-goryachev-oracle
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Dec 8, 2022

Going to push as commit 6abbe08.

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

openjdk bot commented Dec 8, 2022

@andy-goryachev-oracle Pushed as commit 6abbe08.

💡 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 8295809.tree.table.view.skin branch December 8, 2022 16:12
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.

2 participants