Skip to content

[Core] Changes disposing items in CollectionView - #10590

Closed
jsuarezruiz wants to merge 3 commits into
mainfrom
fix-10560
Closed

jsuarezruiz wants to merge 3 commits into
mainfrom
fix-10560

Conversation

@jsuarezruiz

@jsuarezruiz jsuarezruiz commented Oct 10, 2022 •

Copy link
Copy Markdown
Contributor

Description of Change

Changes (disconnecting and disposing Handlers) disposing items in Windows CollectionView.
Testing with a CollectionView having 1000 items scrolling up and down. This is the current behavior:

cv-perf-01-1
cv-perf-01-2

After the changes:
cv-perf-02-1
cv-perf-02-2
The memory consumption and the references count is much lower with the changes.

Forcing a GC.Collect doing scroll:
cv-perf-02-3
We can see how memory is constantly collected and in this case the memory does not increase.

Issues Fixed

Fixes #10560

@jsuarezruiz jsuarezruiz added t/bug Something isn't working legacy-area-perf Startup / Runtime performance area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Oct 10, 2022
@jsuarezruiz
jsuarezruiz marked this pull request as draft October 10, 2022 16:26
ve.Handler?.DisconnectHandler();

if (ve.Handler is IDisposable veHandlerDisposable)
veHandlerDisposable.Dispose();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you remove all the dispose code does that still work?

I don't think we want to start pulling dispose patterns in the code here.

@jsuarezruiz
jsuarezruiz marked this pull request as ready for review October 13, 2022 17:39
@jsuarezruiz jsuarezruiz changed the title [Windows] Changes disposing items in CollectionView [Core] Changes disposing items in CollectionView Oct 13, 2022
@jsuarezruiz
jsuarezruiz marked this pull request as draft October 14, 2022 11:43
@jsuarezruiz

jsuarezruiz commented Nov 3, 2022 •

Copy link
Copy Markdown
Contributor Author

To help focus and move faster, we're going to have fewer open PRs and focus on the ones we'll be working on in each release. This PR require more work or event think in a better approach and for that reason is not included in the next release so I close it for now. I will reopen it and adapt to changes later.

@jsuarezruiz jsuarezruiz closed this Nov 3, 2022
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 17, 2023
@Eilon Eilon added perf/general The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) and removed legacy-area-perf Startup / Runtime performance labels May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView perf/general The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) t/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Massive memory leak in CollectionView while scrolling

3 participants