Skip to content

Instantly share code, notes, and snippets.

Avatar

HonB zjyangyong

View GitHub Profile
@zjyangyong
zjyangyong / OomExceptionHandler.java
Last active Nov 23, 2016 — forked from pyricau/OomExceptionHandler.java
Dump the heap on OutOfMemoryError crashes in your debug builds.
View OomExceptionHandler.java
import android.content.Context;
import android.os.Debug;
import java.io.File;
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final String FILENAME = "out-of-memory.hprof";
public static void install(Context context) {
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
You can’t perform that action at this time.