-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Many controls (mainly iOS) are not collected by GC #18365
Copy link
Copy link
Closed
Labels
area-controls-generalGeneral issues that span multiple controls, or common base classes such as View or ElementGeneral issues that span multiple controls, or common base classes such as View or Elementp/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)perf/memory-leak 💦Memory usage grows / objects live forever (sub: perf)Memory usage grows / objects live forever (sub: perf)platform/ioss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area-controls-generalGeneral issues that span multiple controls, or common base classes such as View or ElementGeneral issues that span multiple controls, or common base classes such as View or Elementp/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)perf/memory-leak 💦Memory usage grows / objects live forever (sub: perf)Memory usage grows / objects live forever (sub: perf)platform/ioss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Done
Description
I'm working on an app for iOS. The app creates new instances of pages and view models every time a new page is pushed to the navigation stack. After a while the app gets very slow and crashes.
So I started to comment out parts of XAML and to trigger GC and found that the pages were no longer cleaned up if they had certain controls.
To find out which controls causes problems I created a simple test programme that does nothing more than adding one single control to a page and pushes that page onto the navigation stack. By clicking a button the garbage collector can be forced to work. The program outputs a debug message when the constructor and finaliser of the opened page is called.
On iOS there are many controls where there is no finaliser call of the page, resulting in memory leaks.
On iOS there is no finaliser log output (~xxx Page) for these controls:
Frame,VisualElementRenderer#18552ImageButton#18602Slider#18681Stepper#18663Switch#18682CarouselView&INotifyCollectionChanged#18267TableView#18718On Windows there is no finaliser log output (~xxx Page) for these controls:
WebView#18810On Android there is no finaliser log output (~xxx Page) for these controls:
CarouselView#18584Steps to Reproduce
Link to public reproduction project repository
https://github.com/heyThorsten/GCTest
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows
Affected platform versions
iOS 16.4 (Simulator), Android 10.0 (Emulator), Windows 10.0.19041.0
Did you find any workaround?
No response
Relevant log output