Files
Amber/app
greenart7c3 591ed2324d Cache decrypted getAll results in CachingApplicationDao
heapprofd profiling showed NotificationSubscription.updateFilter()'s ~30s
relay-refresh cycle re-running ApplicationDao.getAll on the raw Room dao,
re-decrypting every application row through AndroidKeyStore (a keystore2
binder round-trip per encrypted field) forever. That path was the app's
dominant native allocator: ~15% of live native memory plus all periodic
~400KB allocation bursts (1.33MB/90s steady-state churn).

getAll is now a read-through cache: a second small LruCache keyed by
account pubKey, handing out defensive copies. Every application-table
mutation evicts the affected account's entry (or all entries when only
the app key is known); permission-only writes never do.

Call sites that could bypass the wrapper are routed through the cached
dao so the cache cannot go stale: updateFilter's read, HistoryDao's
updateLastUsed write, and ConnectivityService's reconnect write.

Re-profiled post-fix: decrypt-path stacks 0 rows/0 bytes (was 65 rows/
1.14MB per 90s); steady-state churn ~0.26MB/90s (was ~1.33MB); no
periodic bursts.
2026-08-21 06:01:02 -03:00
..
2024-03-01 06:56:32 -03:00
2023-07-26 16:44:33 -03:00
2026-08-18 10:08:22 -03:00