element-hq / element-hq/element-android

Unable to restore key backup from filesystem, "Failed to allocate a X byte allocation"

Open
#2,332 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/1342360/97867662-26a09700-1d06-11eb-8f20-d8b62de83869.png)

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.