You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do things to raise the unread count above ~2600 (receive lots of PMs, be in a lot of active MUCs, have unread history, ...)
Expected result
Conversations does not slow down or crash
Actual result
Conversations' UI gets slower and slower, until it eventually throws an App Not Responding / quits
From the logcat output, it seems like having a lot of unread messages causes Conversations to use a lot of heap space. Eventually, it hits the Android limit and the OS starts forcing GC pauses on it in order to try and reclaim space, which doesn't work; the app becomes unusable, and eventually dies due to App Not Responding.
After restarting, the app only loads ~50 or so messages for each MUC / conversation, so it doesn't run into the issue.
Suggested action: maybe Conversations should evict unread messages from memory when the OS signals heap space is low? It looks like each Conversation keeps around a list of message objects and only gets rid of them after you've read them; it shouldn't be too bad to just deallocate said message objects when memory pressure is encountered, possibly with some logic for not deallocating objects that have caused a push notification.
Relevant debug output
08-30 19:42:19.130 22008 22042 I s.conversation: Starting a blocking GC Alloc
08-30 19:42:19.130 22008 22008 I s.conversation: WaitForGcToComplete blocked Alloc on HeapTrim for 456.877ms
08-30 19:42:19.130 22008 22008 I s.conversation: Starting a blocking GC Alloc
08-30 19:42:19.137 22008 22042 D conversations: update unread count to 2651
08-30 19:42:19.139 22008 22042 D conversations: eta@theta.eu.org: suppressing notification because turned off
08-30 19:42:19.142 22008 22008 I s.conversation: Waiting for a blocking GC Alloc
08-30 19:42:19.142 22008 22042 I s.conversation: Waiting for a blocking GC Alloc
08-30 19:42:19.608 22008 22018 I s.conversation: Clamp target GC heap from 119MB to 96MB
08-30 19:42:19.608 22008 22018 I s.conversation: Background concurrent copying GC freed 3922(101KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 95MB/96MB, paused 154us total 477.449ms
08-30 19:42:19.608 22008 22008 I s.conversation: WaitForGcToComplete blocked Alloc on HeapTrim for 466.686ms
08-30 19:42:19.608 22008 22008 I s.conversation: Starting a blocking GC Alloc
08-30 19:42:19.608 22008 22042 I s.conversation: WaitForGcToComplete blocked Alloc on HeapTrim for 466.510ms
08-30 19:42:19.608 22008 22042 I s.conversation: Starting a blocking GC Alloc
08-30 19:42:19.610 22008 22008 I s.conversation: Waiting for a blocking GC Alloc
08-30 19:42:19.610 22008 22123 I s.conversation: Waiting for a blocking GC Alloc
08-30 19:42:19.610 22008 22042 I s.conversation: Waiting for a blocking GC Alloc
08-30 19:42:20.067 22008 22018 I s.conversation: Clamp target GC heap from 119MB to 96MB
08-30 19:42:20.067 22008 22018 I s.conversation: Background concurrent copying GC freed 3886(155KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 95MB/96MB, paused 115us total 458.027ms
08-30 19:42:20.067 22008 22008 I s.conversation: WaitForGcToComplete blocked Alloc on HeapTrim for 457.452ms
08-30 19:42:20.067 22008 22008 I s.conversation: Starting a blocking GC Alloc
08-30 19:42:20.067 22008 22123 I s.conversation: WaitForGcToComplete blocked Alloc on HeapTrim for 457.314ms
08-30 19:42:20.067 22008 22123 I s.conversation: Starting a blocking GC Alloc
08-30 19:42:20.067 22008 22042 I s.conversation: WaitForGcToComplete blocked Alloc on HeapTrim for 457.279ms
08-30 19:42:20.067 22008 22042 I s.conversation: Starting a blocking GC Alloc
08-30 19:42:20.071 22008 22008 I s.conversation: Waiting for a blocking GC Alloc
08-30 19:42:20.117 22008 22042 I s.conversation: Waiting for a blocking GC Alloc
08-30 19:42:20.250 22008 22019 I s.conversation: Waiting for a blocking GC Alloc
08-30 19:42:20.532 22008 22018 I s.conversation: Clamp target GC heap from 119MB to 96MB
The text was updated successfully, but these errors were encountered:
General information
Steps to reproduce
Expected result
Actual result
From the logcat output, it seems like having a lot of unread messages causes Conversations to use a lot of heap space. Eventually, it hits the Android limit and the OS starts forcing GC pauses on it in order to try and reclaim space, which doesn't work; the app becomes unusable, and eventually dies due to App Not Responding.
After restarting, the app only loads ~50 or so messages for each MUC / conversation, so it doesn't run into the issue.
Suggested action: maybe Conversations should evict unread messages from memory when the OS signals heap space is low? It looks like each
Conversation
keeps around a list of message objects and only gets rid of them after you've read them; it shouldn't be too bad to just deallocate said message objects when memory pressure is encountered, possibly with some logic for not deallocating objects that have caused a push notification.Relevant debug output
The text was updated successfully, but these errors were encountered: