-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of memory allocations and OOM errors #226
Merged
Conversation
This file contains 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
✅ Success! - Legacy Sample screenshot test resultsView build for commit 4809725 |
✅ Success! - Flix Sample screenshot test resultsView build for commit 4809725 |
✅ Success! - Flix Library screenshot test resultsView build for commit 4809725 |
DanielJette
force-pushed
the
2024-06-28-better_memory_handling
branch
from
June 29, 2024 21:53
f6c0f3e
to
12d41dd
Compare
lwise
approved these changes
Jul 2, 2024
AndroidTestifyBot
approved these changes
Jul 5, 2024
jaredh
added a commit
that referenced
this pull request
Jul 8, 2024
Correct reference to issue #226 in 3.1.0
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.
What does this change accomplish?
Parallel pixel processing requires the allocation of two byte buffers. For a typical device resolution of 1080 x 1920, two buffers of approximately 2 MB each (4 MB total) are allocated.
Most AVDs are configured with a heap size of 25% their available RAM. For example, 512 MB for a device with 2 GB of RAM. See: https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/android-emu/android/main-common.c#1292
This is normally more than sufficient for parallel pixel processing. However, in some instances it has been observed where the heap size for androidTest instrumentation runners is set to only 16 MB, which is not sufficient for Testify. If you encounter this exception, please verify that your emulator is correctly configured with at least 2 GB of RAM.
Testify will now throw a
LowMemoryException
when attempts to allocate anIntBuffer
fail. This can help users diagnose AVD configuration problems and reports on the state of the device.