The Linux kernel memory leak tool uses

Source: Internet
Author: User

1. Kernel Add memory leak feature option kernel memory leak detector kernel debugging memory leak debugging Compile kernel With debug info go through make menuconfig into the configuration options interface to enter kernel hacking--and trace to see

2. When booting, mount the Debugfs file system in Android init.xxx.rc file: Mount Debugfs debugfs/sys/kernel/debug Pure Linux system/etc/fstab:deb Ug/sys/kernel/debug Debugfs Defaults 0 0
3. After running the application, review the memory tracker Memleak Cat/sys/kernel/debug/memleak perform multiple times to ensure the correct results are obtained
kmemleak.cThe print_unreferenced function in the file will print out the leaked address
seq_printf (seq, "Unreferenced Object0X%08LX (size%zu): \ n ", Object->pointer, object->size); For example, the address is 0x11223344
4. Use Addr2line to decompile the resulting address to get the file's function xxxxx-linux-addr2line-e vmlinux 11223344//can get the file and the number of rows that the problem appears

The Linux kernel memory leak tool uses

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.