I appear to have a memory leak in the kernel space, slab shows kmalloc-4096 perpetually growing an an even clip until it monopolizes all of the ram resources on the system and forces swap.
Free shows much of this memory usage as cache, but it refuses to free on need, or even when flagged to manually clear. An example of what we're seeing:
$ sudo su -c "free -h && sync && echo 3 > /proc/sys/vm/drop_caches && free -h" total used free shared buff/cache available Mem: 15G 4.4G 166M 280M 10G 104M Swap: 15G 7.8G 8.1G total used free shared buff/cache available Mem: 15G 4.4G 186M 280M 10G 115M Swap: 15G 7.8G 8.1G
Should I be profiling kmalloc to determine where the leak is? If so, how might I go about doing that?
This is a stock Ubuntu 16.04 install on an Intel i5 Skylake.
$ uname -a Linux fire 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux