You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text viewer: large text/markdown files freeze rendering and can run out of memory #6901
Is your feature request related to a problem? Please describe.
This follows up on the review by @rapterjet2004 in #6862, which suggested a separate issue.
I found the following by reading the code at d9abd8e. I did not measure it on a device.
FullScreenTextViewerActivity reads the whole file into memory with readBytes() and then decodes it to a String, so the file is held twice for a moment (FullScreenTextViewerActivity.kt#L114). This call runs in onCreate (L39-L55).
Plain text is one Text inside verticalScroll, so the whole string is measured and laid out at once on the main thread. Markdown is parsed by Markwon in the AndroidView factory, also on the main thread (FullScreenTextScreen.kt#L37-L80).
For a file of several MB, layout and parsing may cost more than the read itself.
Describe the solution you'd like
A size limit for the internal text viewer. Above the limit, the app does not open the file inline and offers "Open in Files" (or an external app) instead.
Describe alternatives you've considered
A lazy, line-based list (LazyColumn), so that only the visible lines are laid out. Markdown would still need a separate solution.
Additional context
I am happy to work on a PR if one of the approaches is acceptable.
The analysis and this text were prepared with an AI assistant and reviewed by me.
Activity
mahibi commentedon Oct 26, 2026
Thank for all the contributions, we will soon have a look!