Skip to content

LeakCanary failed test due to Out of Memory Error #2809

@eduardogomeskramerdasilva

Description

Description

LeakCanary failed test due to Out of Memory Error

Steps to Reproduce

[Provide a sample project, a .hprof file or a failing test]

There is a failing test:

java.lang.OutOfMemoryError: Failed to allocate a 40 byte allocation with 758360 free bytes and 740KB until OOM, target footprint 201326592, growth limit 201326592; giving up on allocation because <1% of heap free after GC.
	at shark.internal.HprofInMemoryIndex.readClass(HprofInMemoryIndex.kt:295)
	at shark.internal.HprofInMemoryIndex.indexedObjectOrNull(HprofInMemoryIndex.kt:254)
	at shark.HprofHeapGraph.findObjectByIdOrNull(HprofHeapGraph.kt:167)
	at shark.HprofHeapGraph.findObjectById(HprofHeapGraph.kt:151)
	at shark.internal.GcRootProvider.sortedGcRoots(GcRootProvider.kt:138)
	at shark.internal.GcRootProvider.provideGcRoots(GcRootProvider.kt:55)
	at shark.internal.PathFinder.enqueueGcRoots(PathFinder.kt:193)
	at shark.internal.PathFinder.findPathsFromGcRoots(PathFinder.kt:146)
	at shark.internal.PathFinder.findPathsFromGcRoots(PathFinder.kt:135)
	at shark.HeapAnalyzer.findLeaks(HeapAnalyzer.kt:275)
	at shark.HeapAnalyzer.analyzeGraph(HeapAnalyzer.kt:253)
	at shark.HeapAnalyzer.analyze$shark(HeapAnalyzer.kt:217)
	at shark.HeapAnalyzer.analyze(HeapAnalyzer.kt:166)
	at leakcanary.internal.AndroidDebugHeapAnalyzer.analyzeHeap(AndroidDebugHeapAnalyzer.kt:156)
	at leakcanary.internal.AndroidDebugHeapAnalyzer.runAnalysisBlocking(AndroidDebugHeapAnalyzer.kt:59)
	at leakcanary.internal.AndroidDebugHeapAnalyzer.runAnalysisBlocking$default(AndroidDebugHeapAnalyzer.kt:46)
	at leakcanary.internal.HeapAnalyzerWorker.doWork(HeapAnalyzerWorker.kt:20)
	at androidx.work.Worker$startWork$1.invoke(Worker.kt:64)
	at androidx.work.Worker$startWork$1.invoke(Worker.kt:64)
	at androidx.work.WorkerKt.future$lambda$2$lambda$1(Worker.kt:100)
	at androidx.work.WorkerKt.$r8$lambda$06LNzu7McnKR6G06fSbfQ2BCegc(Unknown Source:0)
	at androidx.work.WorkerKt$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1154)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:652)
	at java.lang.Thread.run(Thread.java:1564)

Build.VERSION.SDK_INT: 33
Build.MANUFACTURER: motorola
LeakCanary version: 2.14
Analysis duration: 19420 ms
Heap dump file path: /storage/emulated/0/Download/leakcanary-org.schabi.newpipe.debug.release0284/2026-03-11_02-40-38_714.hprof
Heap dump timestamp: 1773207671585

Expected behavior: Not to crash...

Version Information

  • LeakCanary version: 2.14 (NewPipe)
  • Android OS version: 13
  • Gradle version: -

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions