fix: move http upload state to heap#657
Merged
daveallie merged 2 commits intocrosspoint-reader:masterfrom Feb 5, 2026
Merged
Conversation
daveallie
previously approved these changes
Feb 2, 2026
daveallie
approved these changes
Feb 5, 2026
jdk2pq
added a commit
to jdk2pq/crosspoint-reader
that referenced
this pull request
Feb 5, 2026
* master: feat: add shift lock to KeyboardEntryActivity (crosspoint-reader#513) feat: rename and move in file manager (crosspoint-reader#630) feat: Implement fix for sunlight fading issue (crosspoint-reader#603) chore: Add PR title check on sync (crosspoint-reader#698) feat: Go To Position for epubs (crosspoint-reader#666) feat: Calibre Web Automated (CWA) koreader sync server support (crosspoint-reader#594) chore: Add CI check job to consolidate status (crosspoint-reader#696) chore: CI Build Summary - firmware stats, firmware artifact (crosspoint-reader#601) feat: quick rotate option in epub reader menu (crosspoint-reader#685) feat(settings): add "Cover + Custom" sleep screen mode (crosspoint-reader#582) fix: Artifacts on Thumb on Home Screen (crosspoint-reader#662) feat: holding back button while booting, boots to home screen as a mean of escaping boot loop (crosspoint-reader#587) docs: Add small SCOPE.md and GOVERNANCE.md documents (crosspoint-reader#640) feat: front button remapper (crosspoint-reader#664) feat: UI themes, Lyra (crosspoint-reader#528) feat: Add CSS parsing and CSS support in EPUBs (crosspoint-reader#411) fix: move http upload state to heap (crosspoint-reader#657)
Unintendedsideeffects
pushed a commit
to Unintendedsideeffects/crosspoint-reader
that referenced
this pull request
Feb 17, 2026
## Summary The main motivation behind this PR was because `uploadBuffer` is statically allocated, but only used when web server is enabled. This results in 4KB of memory sitting idle most of the time. As expected, 4KB of initial RAM is freed with this PR: ``` master: RAM: [=== ] 32.5% (used 106508 bytes from 327680 bytes) PR: RAM: [=== ] 31.2% (used 102276 bytes from 327680 bytes) ``` ## Additional Context This also highlights the importance of only using statically-allocated buffer when absolutely needed (for example, if the component is active most of the time). Otherwise, it makes more sense to tie the buffer's life cycle to its activity. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? NO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The main motivation behind this PR was because
uploadBufferis statically allocated, but only used when web server is enabled. This results in 4KB of memory sitting idle most of the time.As expected, 4KB of initial RAM is freed with this PR:
Additional Context
This also highlights the importance of only using statically-allocated buffer when absolutely needed (for example, if the component is active most of the time). Otherwise, it makes more sense to tie the buffer's life cycle to its activity.
AI Usage
While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? NO