Skip to content

Testing, do not merge — OOM fix CI run 3/9#293

Draft
djette-st wants to merge 2 commits intomainfrom
fix-oom-test-3
Draft

Testing, do not merge — OOM fix CI run 3/9#293
djette-st wants to merge 2 commits intomainfrom
fix-oom-test-3

Conversation

@djette-st
Copy link
Collaborator

This PR is only to trigger parallel CI builds. Do not merge.

CI stress test run for the OOM fix on branch fix-oom (#281).

- 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
@DanielJette
Copy link
Contributor

	✓ Recording baseline for AssertExpectedDeviceTest_testMissingBaselineRecordMode.
dev.testify.BitmapCompareTest:...
dev.testify.ExperimentalPixelCopyTest:..
dev.testify.FuzzyCompareBitmapTest:...
dev.testify.RuleLifecycleTest:.....
dev.testify.ScreenshotAnnotationTest:.
dev.testify.ScreenshotInstrumentationOrientationTest:..
dev.testify.ScreenshotLifecycleTest:.
dev.testify.ScreenshotRuleLifecycleTest:
Error in default(dev.testify.ScreenshotRuleLifecycleTest):
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw an exception; no stack trace available

dev.testify.ScreenshotUtilityTest:...
dev.testify.ViewModificationExceptionTest:.
dev.testify.core.processor.BitmapExtensionsTest:....
dev.testify.core.processor.ImageBufferTest:.......
dev.testify.scenario.ScenarioRuleAnnotationTest:.
dev.testify.scenario.ScenarioRuleAssertExpectedDeviceTest:....
dev.testify.scenario.ScenarioRuleExceptionTest:...
dev.testify.scenario.ScenarioRuleLifecycleTest:
Error in default(dev.testify.scenario.ScenarioRuleLifecycleTest):
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw an exception; no stack trace available

dev.testify.scenario.ScenarioRuleOrientationTest:..
dev.testify.scenario.ScenarioTestRuleLifecycleTest:.....
dev.testify.scenario.ScreenshotScenarioLifecycleTest:.
dev.testify.scenario.ScreenshotScenarioRuleDefaultTest:.

Time: 67.364
There were 2 failures:
1) default(dev.testify.ScreenshotRuleLifecycleTest)
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw an exception; no stack trace available
2) default(dev.testify.scenario.ScenarioRuleLifecycleTest)
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw an exception; no stack trace available

FAILURES!!!
Tests run: 56,  Failures: 2

Copy link
Contributor

@DanielJette DanielJette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI Failed

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