Skip to content

Core IO: Improve performance and fix memory issues when reading large folders with root or shizuku - #1127

Merged
d4rken merged 3 commits into
mainfrom
root_path_walking_stream
Apr 10, 2024
Merged

d4rken merged 3 commits into
mainfrom
root_path_walking_stream

Conversation

@d4rken

@d4rken d4rken commented Apr 9, 2024

Copy link
Copy Markdown
Member

Implement Flow<LocalPath> for inter process communication, this reduces memory pressure. Previously when walking large folders (e.g. Termux), all folder contents were gathered in memory before being send to the main process. This could lead to the root/shizuku process running out of memory. Now we stream the walked folders in chunks so that everything doesn't have to be in memory all at once.

Fixes #1117

d4rken added 2 commits April 9, 2024 13:52
… folders with root or shizuku

Implement `Flow<LocalPath>` for inter process communication, this reduces memory pressure.
Previously when walking large folders (e.g. Termux), all folder contents were gathered in memory before being send to the main process.
This could lead to the root/shizuku process running out of memory.
Now we stream the walked folders in chunks so that everything doesn't have to be in memory all at once.

Fixes #1117
@d4rken d4rken added enhancement New feature, request, improvement or optimization c: IO SAF/Normal/Root access Root ADB ADB/Shizuku related labels Apr 9, 2024
@d4rken
d4rken merged commit 4aebb04 into main Apr 10, 2024
@d4rken
d4rken deleted the root_path_walking_stream branch April 10, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ADB ADB/Shizuku related c: IO SAF/Normal/Root access enhancement New feature, request, improvement or optimization Root

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scanning large folder structures with root causes OutOfMemoryError

1 participant