Skip to content

Commit

Permalink
Update recover-from-OOM experiment setup
Browse files Browse the repository at this point in the history
Reviewed By: wizh

Differential Revision: D22546950

fbshipit-source-id: 4cc49c7c806f4f67f58ae2c5c2e0d03d9a2ba28b
  • Loading branch information
defHLT authored and facebook-github-bot committed Jul 15, 2020
1 parent a9a2d71 commit 0de3d2c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,11 @@ private void doDecode(EncodedImage encodedImage, @Status int status) {
private CloseableImage internalDecode(
EncodedImage encodedImage, int length, QualityInfo quality) {
CloseableImage image;
final boolean recover = mReclaimMemoryRunnable != null && mRecoverFromDecoderOOM.get();
try {
image = mImageDecoder.decode(encodedImage, length, quality, mImageDecodeOptions);
} catch (OutOfMemoryError e) {
if (!mRecoverFromDecoderOOM.get() || mReclaimMemoryRunnable == null) {
if (!recover) {
throw e;
}

Expand Down

0 comments on commit 0de3d2c

Please sign in to comment.