This tool is used to sneak for memory leaks in a process. It traces outstanding memory allocations that were not freed by a process.
It supports both user mode allocations and kernel mode allocations. Currently supporting memory allocation performed with various libc functions and also kernel mode functions like kmalloc/kmem_cache_alloc/get_free_pages
.
It also maintains the count of various memory allocation functions.
You must have bcc installed on your machine in order to run this tracer.
To install bcc
, follow the instructions given on this link.
Clone the repository and navigate to the folder. Then run
pip install -r requirements.txt
To run sample binary in examples/
directory
sudo python3 memSneak.py -c "./example/main"
Pass the --freq
flag to count the frequency of each allocation
To run the tool on all the kernel processes
sudo python3 memSneak.py
To run the tool for specific PID
sudo python3 memSneak.py -p <PID>
To lookout for more options
sudo python3 memSneak.py -h