I am writing an application entirely on JetpackCom...
# compose
I am writing an application entirely on JetpackCompose with MultipleActivity approach. I noticed that all Activities are leaking (except for the first one). I removed all the code in the Activity (except for setContent) - they still leak when changing the configuration. I don't keep links to Activity anywhere. If you comment out
setContent {}
, the leaks disappear, but I can't work with Compose without this function. Can you tell me what is causing the leaks? How can they be fixed? All useful info attached to the post.
Compose version is 1.2.0-beta01
is leaking
could you file a bug about this?
@py? Didn't you say something about this on twitter by chance?
I've found that
leaks because of multi activity approach, not because of some specific Compose constructions. For example, such simple construction as Column with Text and Image leaks in multi-activity app. But there is no leaks in single-activity approach with Jetpack Compose Navigation. I've rewritten my app on Jetpack Compose Navigation, and my app has no memory leaks now :)
K 1
On Twitter I was surfacing a bunch of Compose leaks that seemed to be related to the compose testing rules etc. This once again points to the compose team needed to set up leakcanary (or similar) on their master.
👍 2