Skip to content

Conversation

@mauricecarrier7
Copy link
Contributor

Release 2.0.2

mauricecarrier7 and others added 30 commits October 15, 2025 16:01
…tion-is-off

[PP-3022][PP-3077] Show proper holds position, hide epub tabbar
mauricecarrier7 and others added 16 commits October 21, 2025 17:11
- Added totalCostLimit and countLimit to all NSCache instances
- GeneralCache: 50-150MB limit per instance based on device memory
- TPPEncryptedPDFDocument: 30-80MB limit for PDF thumbnails
- Added cost tracking for all cache setObject calls
- Decentralized memory warning handling (each cache manages itself)
- Removed redundant clearAllCaches() call from MemoryPressureMonitor
- Changed to async memory clearing to avoid blocking main thread

This prevents NSMallocException 'Failed to grow buffer' crashes that occur
when removeAllObjects() is called on unbounded caches during memory pressure.
Limits are generous and won't impact normal usage or downloads.
- PDF Text Extractor: Replaced string += concatenation with array.joined()
- Added 50KB block size limit to prevent unbounded text extraction
- Pre-allocate array capacity for better performance
- Added size guards to break out of loops before hitting memory limits

- Audiobook Logger: Added 2MB file size limit to prevent unbounded growth
- Truncate log retrieval to last 1MB for large files
- Use FileHandle streaming instead of loading entire files into memory

These changes prevent NSMallocException '__CFStringHandleOutOfMemory' crashes
that occur when string buffers grow too large during PDF parsing or log operations.
Resolves layout issues during navigation transitions
@mauricecarrier7 mauricecarrier7 self-assigned this Oct 27, 2025
@mauricecarrier7 mauricecarrier7 marked this pull request as ready for review October 27, 2025 15:08
@mauricecarrier7 mauricecarrier7 merged commit 1b0b22a into main Oct 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants