Files
workavia-mail-front/docs/adr/0079-reduce-twake-mail-mobile-memory-usage.md
T
2026-04-09 18:26:19 +07:00

1.7 KiB

0079 - Reduce Twake Mail mobile memory usage

Date: 2026-04-09

Status

Accepted

Context

Twake Mail is allocating a lot of memory on mobile.

  • ~375 MB on Android (Oneplus 8T)
  • ~297 MB on iOS (iPhone 11 Pro)

Findings

worker_manager library's inefficient memory allocation (Android & iOS)

  • Version 5.0.3 counts the number of processors (x) on the device, create forever-live x - 1 isolates
  • Version 7.2.7 adds an ability to create isolate on-demand, and dispose when done. However, it still leaks 1 isolate when init.

firebase_messaging library's eager background Dart isolate (Android)

Unused flutter_downloader library's worker (iOS)

Decision

worker_manager

  • Upgrade to 7.2.7
  • Create an upstream fix for init's isolate leak

firebase_messaging

flutter_downloader

  • Remove the library

Consequences

  • Android: ~118 MB
  • iOS: ~78 MB
  • No changes for web
Before After