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
ComposeUIViewController not released at all #3201
ComposeUIViewController not released at all #3201
Comments
i think problem is reference cycle with keyboard observer as i know for K/N difficult to understand cycles between Kotlin & ObjC boundaries |
Had the same problem. I thought that was my fault of leaked reference somewhere :) |
I have a workaround for this. I just set the |
The problem is pinned down and is related to GC. In this particular case it's resolved via using new Kotlin language feature to manually release native API reference counted objects when their lifetime is critical for correct usage of API (CAMetalDrawable is living for too long and holds IOSurface memory). The latest possible moment the fix arrives is release associated with Kotlin 1.9.0. |
I found more sources of this leak caused by interaction of GC and ARC-managed memory, to be resolved later |
The leak of ComposeWindow itself (but not all associated resources) is fixed in this PR |
Describe the bug
I embed
ComposeUIViewController
to native iOS navigation. When i navigate back currentComposeUIViewController
should release memory, but it's not.Affected platforms
Versions
To Reproduce
Simulate memory warning
on simulator - you see in logs that manyComposeUIViewController
got this warningExpected behavior
ComposeUIViewController
should release memory when it's not used by app.Screenshots
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: