Android's method of detecting memory leaks is more and more convenient, and the following is a list of ways to detect C + + memory leaks in different scenarios.
Android O (for root device, debug app)
1. Prepare a userdebug or ENG version of the phone, download the native_heapdump_viewer.py script backup
2. Execute the following command
' "Libc_debug_malloc_options=backtrace" '
3. Execute the recurrence path n times
4. Execute the following command, where/some/path/to/symbols/refers to the folder with the symbol information so file, which is $android_product_out/symbols by default.
ADB shell am dumpheap-n <PID_TO_DUMP>/data/local/tmp//data/local/tmp/Heap.txtpython Development /scripts/native_heapdump_viewer.py--html--symbols/some/path/to/symbols/heap.txt > heap_info.html
Android O (Debug app for non-root device)
Cond...
Android Native Memory Leak detection method