element-hq / element-hq/element-android
Unable to restore key backup from filesystem, "Failed to allocate a X byte allocation"
- Dominant language
- Kotlin
- Stars
- 3.7k
- Forks
- 917
- PR merge metrics
- No merged PRs in 30d
Description

Looks like my phone is denying the app from restoring my key backup file due to not having enough memory. A possible solution may just be to find a more memory-efficient way to restore key backup.
The issue may be that we're trying to load the whole encrypted file into memory in order to decrypt it. Perhaps it's possible to decrypt it from disk in the case of this error? It would be slower, but it wouldn't require more memory than the device can provide.
**To Reproduce**
Steps to reproduce the behavior:
1. Get a big key backup file (this one is ~39MB)
2. Have very little memory on your device(?)
3. Try to restore the key backup
4. See error
**Smartphone (please complete the following information):**
- Device: Google Pixel XL
- OS: Android 10.0
**Additional context**
- App version and store: GPlay, Count.ly build
- Homeserver: amorgan.xyz
Rageshake: https://github.com/matrix-org/element-android-rageshakes/issues/16384
Contributor guide
Assessment
This issue has not been assessed yet.