OutOfMemoryError on Low-Memory Devices (Android 16, SDK 36)
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
### ⚠️ Before posting ⚠️
- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [x] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
### Steps to reproduce
1. Install Nextcloud client from F-Droid on a low-memory Android 16 device.
2. Connect to Nextcloud server instance.
3. Navigate the app—open files, browse folders, interact via touch.
4. After sustained interaction (variable duration), the app crashes with OutOfMemoryError.
### Expected behaviour
App handles touch input events without unbounded memory growth.
### Actual behaviour
App crashes. Heap reaches 256MB limit with <1% free after garbage collection. Even a 24-byte allocation fails.
### Android version
16 (SDK 36)
### Device brand and model
Ulefone Armor X32 Pro (GQ5021AH1)
### Stock or custom OS?
Stock
### Nextcloud android app version
340010090
### Nextcloud server version
Nextcloud hosted on Pikapod.net 34.0.2-apache
### Using a reverse proxy?
No
### Android logs
Exception in thread "main" java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 2052080 free bytes and 2003KB until OOM, target footprint 268435454, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
at com.pri.ai.PriInputMonitorPolicy.onDownEvent(PriInputMonitorPolicy.java:180)
at com.pri.ai.PriInputMonitorPolicy.onInterceptTouchEvent(PriInputMonitorPolicy.java:146)
at com.pri.ai.PriInputMonitorPolicy.onInputEvent(PriInputMonitorPolicy.java:126)
at android.view.ViewRootImpl.processRawInputEvent(ViewRootImpl.java:11283)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:11048)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:300)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.nextLegacy(MessageQueue.java:904)
at android.os.MessageQueue.next(MessageQueue.java:1016)
at android.os.Looper.loopOnce(Looper.java:196)
at android.os.Looper.loop(Looper.java:338)
at android.app.ActivityThread.main(ActivityThread.java:9122)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:614)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1022)
### Server error logs
```bash
```
### Additional information
_No response_
Contributor guide
Research direction
Start with the Android stack trace, especially PriInputMonitorPolicy.onDownEvent, onInterceptTouchEvent, and onInputEvent, and reproduce the sustained-touch interaction on the listed low-memory Android 16 device. Determine whether the failure is reachable from the Nextcloud app or belongs to the device software; done means the app no longer crashes from unbounded heap growth during navigation and touch input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100