Re: RFR: 8277848 Binding and Unbinding to List leads to memory leak [v3]
On Wed, 5 Jan 2022 18:14:44 GMT, Florian Kirmaier wrote: >> Making the initial listener of the ListProperty weak fixes the problem. >> The same is fixed for Set and Map. >> Due to a smart implementation, this is done without any performance drawback. >> (The trick is to have an object, which is both the WeakReference and the >> Changelistener) >> By implying the same trick to the InvalidationListener, this should even >> improve the performance of the collection properties. > > Florian Kirmaier has updated the pull request incrementally with one > additional commit since the last revision: > > JDK-8277848 > Further optimization based code review. > This Bugfix should now event improve the performance I've added the 3 requested whitespaces! It sill would be great if CI could catch these minor problems. - PR: https://git.openjdk.java.net/jfx/pull/689
Re: RFR: 8277848 Binding and Unbinding to List leads to memory leak [v3]
On Wed, 5 Jan 2022 18:14:44 GMT, Florian Kirmaier wrote: >> Making the initial listener of the ListProperty weak fixes the problem. >> The same is fixed for Set and Map. >> Due to a smart implementation, this is done without any performance drawback. >> (The trick is to have an object, which is both the WeakReference and the >> Changelistener) >> By implying the same trick to the InvalidationListener, this should even >> improve the performance of the collection properties. > > Florian Kirmaier has updated the pull request incrementally with one > additional commit since the last revision: > > JDK-8277848 > Further optimization based code review. > This Bugfix should now event improve the performance modules/javafx.base/src/main/java/javafx/beans/property/ListPropertyBase.java line 338: > 336: public void onChanged(Change change) { > 337: ListPropertyBase ref = get(); > 338: if(ref != null) { Minor: space after `if` modules/javafx.base/src/main/java/javafx/beans/property/MapPropertyBase.java line 339: > 337: public void onChanged(Change change) { > 338: MapPropertyBase ref = get(); > 339: if(ref != null) { Minor: space after `if` modules/javafx.base/src/main/java/javafx/beans/property/SetPropertyBase.java line 341: > 339: public void onChanged(Change change) { > 340: SetPropertyBase ref = get(); > 341: if(ref != null) { Minor: space after `if` - PR: https://git.openjdk.java.net/jfx/pull/689
Re: RFR: 8277848 Binding and Unbinding to List leads to memory leak [v3]
> Making the initial listener of the ListProperty weak fixes the problem. > The same is fixed for Set and Map. > Due to a smart implementation, this is done without any performance drawback. > (The trick is to have an object, which is both the WeakReference and the > Changelistener) > By implying the same trick to the InvalidationListener, this should even > improve the performance of the collection properties. Florian Kirmaier has updated the pull request incrementally with one additional commit since the last revision: JDK-8277848 Further optimization based code review. This Bugfix should now event improve the performance - Changes: - all: https://git.openjdk.java.net/jfx/pull/689/files - new: https://git.openjdk.java.net/jfx/pull/689/files/f9b7009b..ec90b3d1 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jfx=689=02 - incr: https://webrevs.openjdk.java.net/?repo=jfx=689=01-02 Stats: 106 lines in 3 files changed: 15 ins; 63 del; 28 mod Patch: https://git.openjdk.java.net/jfx/pull/689.diff Fetch: git fetch https://git.openjdk.java.net/jfx pull/689/head:pull/689 PR: https://git.openjdk.java.net/jfx/pull/689