Is there a way to take a memory dump when the application crashes?

I am busy writing an application, and I noticed that it sometimes crashes, and when it does, and I return to my computer, then I only have a stack trace.

Is there any way to take an application memory dump during a crash?

thank

+3
source share
3 answers

If you call android.os.Debug.dumpHprofData (String fileName), you can grab an HPROF dump, which can be viewed using jhat or MAT. You need to somehow catch the exception (either try / catch, or specify your own global default exception handler), and if you want to write to / sdcard, you need permission WRITE_EXTERNAL_STORAGE.

. Dalvik Heap.

+4

, ACRA, http://code.google.com/p/acra/, (Application Crash Report Android) , , .

, , , , , . , /, .

, .

+1

Is there any way to take an application memory dump during a crash?

Not that I know - sorry!

+1
source

Source: https://habr.com/ru/post/1767952/


All Articles