Is there a way to have an Android process produce a heap dump on an OutOfMemoryError?

前端 未结 3 1556
礼貌的吻别
礼貌的吻别 2020-12-08 03:14

The sun JVM supports a -XX:+HeapDumpOnOutOfMemoryError option to dump heap whenever a java process runs out of heap.

Is there a similar option on Androi

3条回答
  •  無奈伤痛
    2020-12-08 03:35

    I have no idea if this works, but you might try adding a top-level exception handler, and in there asking for a heap dump if it is an OutOfMemoryError.

提交回复
热议问题