Draft
Conversation
- Recycle captured bitmap in createBitmapFromActivity() after saving to disk, eliminating ~9.6 MB leaked per test invocation - Switch IntBuffer allocation from heap (IntBuffer.allocate) to native memory (ByteBuffer.allocateDirect) to bypass JVM heap constraints - Add overflow guard for large capacity * INTEGER_BYTES computations - Wrap ParallelPixelProcessor analyze() and transform() in try/finally to guarantee buffer cleanup on exceptions - Recycle diff bitmap in HighContrastDiff.generate() after saving - Update ImageBufferTest to reflect direct buffer allocation behavior
Replace full-image IntBuffer allocation with stripe-based processing to dramatically reduce peak Java heap usage during bitmap comparison. - Process bitmaps in horizontal stripes using Bitmap.createBitmap() sub-regions and copyPixelsToBuffer(), keeping per-stripe heap usage under ~1 MB instead of ~19 MB for full-image buffers - Stripe height is dynamically calculated based on available heap memory - Revert ByteBuffer.allocateDirect() change (no benefit on Android where direct buffers use VMRuntime.newNonMovableArray on the Java heap) - Add mockBitmapCreateBitmap() test helper and update all processor tests
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.
CI stress test run for the OOM fix on branch
fix-oom(#281).