From 3b59b11e8b43a270e8bdcd07d8f99ea0ee0e43d1 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 29 Aug 2025 09:35:05 -0400 Subject: [PATCH] Ignores out of memory exceptions because the stack trace is irrelevant in those cases. --- .../amethyst/service/crashreports/UnexpectedCrashSaver.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/crashreports/UnexpectedCrashSaver.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/crashreports/UnexpectedCrashSaver.kt index 4c804b61e..7d5e17eb0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/crashreports/UnexpectedCrashSaver.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/crashreports/UnexpectedCrashSaver.kt @@ -33,8 +33,11 @@ class UnexpectedCrashSaver( t: Thread, e: Throwable, ) { - scope.launch { - cache.writeReport(ReportAssembler().buildReport(e)) + if (e !is OutOfMemoryError) { + // OOM reports are junk + scope.launch { + cache.writeReport(ReportAssembler().buildReport(e)) + } } defaultUEH!!.uncaughtException(t, e) }