Skip to content

android_benchmark

alhah edited this page Aug 8, 2020 · 1 revision

KOOM for Android

Dump hprof needs to suspend the virtual machine to ensure that the reference relationship will not change during the process of copying the memory data to the disk. The suspend time is usually more than 10 seconds, which is unacceptable for users. This is also one of the important reasons why LeakCanary official recommending offline use. Using the Copy-on-write mechanism, fork child process dump hprof can perfectly solve this problem. After the fork is successful, the parent process immediately resumes the virtual machine running, and the child process will not be affected by the parent process data changes during the dump process.

Randomly dump hprof of real users online, and the time consumed by normal dump and for dump blocking users is as follows:

Dump hprof performance

Clone this wiki locally