Android Native Memory Leak detection method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.