Open brian-livefront opened 4 months ago
Hello,
I have encountered the same issue with TopicViewModel. Here are the steps to reproduce it:
You'll notice that TopicViewModel is still present. The memory leak appears to be related to a lambda function referencing the ViewModel. Upon further inspection, it seems the ViewModel is retained by the AccessibilityManager as shown below:
Is there any update on this issue ?
By the way, even in another Android app using Compose, I noticed the same behavior. ViewModels seem to be kept in memory even after onCleared
is called.
thank you
yes I have encountered the same issue too
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
What happened?
The
SearchViewModel
(and likely other ViewModels) appears to leak after navigating to the search screen and back to the main screen. This seems to be related to this Compose issue.Steps to reproduce
SearchViewModel
in the heap.The
SearchViewModel
will still be present in the heap even though the screen was left and many garbage collections were attempted.Relevant logcat output
No response
Code of Conduct