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

8237926: Potential memory leak of model data in javafx.scene.control.ListView #132

Conversation

arapte
Copy link
Member

@arapte arapte commented Mar 2, 2020

The selection model of ListView stores a strong reference to the most recently changed item in SelectedItemsReadOnlyObservableList.itemsListChange, which causes a leak.

Fix:
The below member variables and method of class SelectedItemsReadOnlyObservableList are not required anymore.
Variables: itemsList, itemsListChanged, itemsListChange, itemsListListener.
Method: setItemsList

These members were added when this class was created for JDK-8154216.
But after the fix for JDK-8152396, these class members are not required.

Verification:
No failure in existing tests and added a new test.


Progress

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

Issue

  • JDK-8237926: Potential memory leak of model data in javafx.scene.control.ListView

Reviewers

  • Kevin Rushforth (kcr - Reviewer)
  • Ajit Ghaisas (aghaisas - Reviewer)

Download

$ git fetch https://git.openjdk.java.net/jfx pull/132/head:pull/132
$ git checkout pull/132

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 2, 2020

👋 Welcome back arapte! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request.

@openjdk openjdk bot added the rfr Ready for review label Mar 2, 2020
@mlbridge
Copy link

mlbridge bot commented Mar 2, 2020

Webrevs

@kevinrushforth kevinrushforth self-assigned this Mar 2, 2020
@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Mar 2, 2020

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

@kevinrushforth
Copy link
Member

As I mentioned in the bug report for JDK-8240287, I recommend using JDK-8227619 as the bug ID for this fix (and closing JDK-8240287 in JBS as a duplicate). I think that you should be able to just change the title of this PR.

@kevinrushforth
Copy link
Member

Is it possible to create a test for the leak?

@arapte arapte changed the title 8240287: SelectedItemsReadOnlyObservableList cleanup: remove unused code. 8237926: Potential memory leak of model data in javafx.scene.control.ListView Mar 3, 2020
@arapte
Copy link
Member Author

arapte commented Mar 3, 2020

Hi Kevin, I have updated the PR according to both the comments. Please take a look.

@kevinrushforth kevinrushforth self-requested a review March 3, 2020 12:58
@kevinrushforth
Copy link
Member

Thanks. I'll put it on my review queue.

@openjdk
Copy link

openjdk bot commented Mar 4, 2020

@arapte This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type /integrate in a new comment to proceed. After integration, the commit message will be:

8237926: Potential memory leak of model data in javafx.scene.control.ListView

Reviewed-by: kcr, aghaisas
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /solves command.

Since the source branch of this PR was last updated there have been 3 commits pushed to the master branch. Since there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate 960f03908980ad8d76ea2b3c1f1043f2675ec003.

➡️ To integrate this PR with the above commit message, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Mar 4, 2020
@arapte
Copy link
Member Author

arapte commented Mar 5, 2020

/integrate

@openjdk openjdk bot closed this Mar 5, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Ready to be integrated labels Mar 5, 2020
@openjdk
Copy link

openjdk bot commented Mar 5, 2020

@arapte The following commits have been pushed to master since your change was applied:

  • 960f039: 8208761: Update constant collections to use the new immutable collections
  • 10c9528: 8240265: iOS: Unnecessary logging on pinch gestures
  • 4c132cd: 8237889: Update libxml2 to version 2.9.10

Your commit was automatically rebased without conflicts.

Pushed as commit 337ed72.

@openjdk openjdk bot removed the rfr Ready for review label Mar 5, 2020
@mlbridge
Copy link

mlbridge bot commented Mar 5, 2020

Mailing list message from Ambarish Rapte on openjfx-dev:

Changeset: 337ed72
Author: Ambarish Rapte <arapte at openjdk.org>
Date: 2020-03-05 03:38:39 +0000
URL: https://git.openjdk.java.net/jfx/commit/337ed722

8237926: Potential memory leak of model data in javafx.scene.control.ListView

Reviewed-by: kcr, aghaisas

! modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/SelectedItemsReadOnlyObservableList.java
! modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java
! modules/javafx.controls/src/main/java/javafx/scene/control/TableView.java
! modules/javafx.controls/src/test/java/test/javafx/scene/control/ListViewTest.java

@arapte arapte deleted the SelectedItemsReadOnlyObservableList_cleanup_JDK-8240287 branch April 28, 2020 15:46
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.

3 participants