$ sudo /usr/share/bcc/tools/memleak # (...) # (much spam while I launched 100 instances of glxgears, then killed them) # (...) [22:46:15] Top 10 stacks with outstanding allocations: 188416 bytes in 46 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] pte_alloc_one+0x14 [kernel] __pte_alloc+0x18 [kernel] __handle_mm_fault+0x12fb [kernel] handle_mm_fault+0xce [kernel] __do_page_fault+0x244 [kernel] do_page_fault+0x33 [kernel] page_fault+0x1e [kernel] 196608 bytes in 15 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] new_slab+0x343 [kernel] ___slab_alloc+0x44c [kernel] __slab_alloc.isra.0+0x52 [kernel] __kmalloc_node_track_caller+0x1da [kernel] __kmalloc_reserve.isra.0+0x2d [kernel] __alloc_skb+0x87 [kernel] alloc_skb_with_frags+0x4d [kernel] sock_alloc_send_pskb+0x1ef [kernel] unix_stream_sendmsg+0x270 [kernel] sock_sendmsg+0x4f [kernel] sock_write_iter+0x8f [kernel] do_iter_readv_writev+0x166 [kernel] do_iter_write+0x7d [kernel] vfs_writev+0xbd [kernel] do_writev+0x73 [kernel] do_syscall_64+0x5f [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 196608 bytes in 6 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] new_slab+0x343 [kernel] ___slab_alloc+0x44c [kernel] __slab_alloc.isra.0+0x52 [kernel] kmem_cache_alloc+0x180 [kernel] ext4_alloc_inode+0x18 [kernel] alloc_inode+0x1d [kernel] iget_locked+0xd3 [kernel] __ext4_iget+0x12d [kernel] ext4_lookup+0xd4 [kernel] __lookup_slow+0x95 [kernel] lookup_slow+0x36 [kernel] walk_component+0x1e5 [kernel] path_lookupat.isra.0+0x76 [kernel] filename_lookup+0xc2 [kernel] vfs_statx+0x8c [kernel] __se_sys_newlstat+0x4c [kernel] do_syscall_64+0x5f [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 376832 bytes in 92 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] alloc_pages_vma+0x7d [kernel] wp_page_copy+0xbf [kernel] do_wp_page+0x95 [kernel] __handle_mm_fault+0xc29 [kernel] handle_mm_fault+0xce [kernel] __do_page_fault+0x244 [kernel] do_page_fault+0x33 [kernel] page_fault+0x1e [kernel] 385024 bytes in 94 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] alloc_pages_vma+0x7d [kernel] shmem_alloc_page+0x54 [kernel] shmem_alloc_and_acct_page+0x7c [kernel] shmem_getpage_gfp.isra.0+0x16e [kernel] shmem_fault+0xa1 [kernel] __do_fault+0x38 [kernel] __handle_mm_fault+0xd47 [kernel] handle_mm_fault+0xce [kernel] __do_page_fault+0x244 [kernel] do_page_fault+0x33 [kernel] page_fault+0x1e [kernel] 909312 bytes in 222 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] pagecache_get_page+0xdb [kernel] __getblk_gfp+0xe3 [kernel] __breadahead+0x2b [kernel] __ext4_get_inode_loc+0x34a [kernel] __ext4_iget+0x15e [kernel] ext4_lookup+0xd4 [kernel] __lookup_slow+0x95 [kernel] lookup_slow+0x36 [kernel] walk_component+0x1e5 [kernel] path_lookupat.isra.0+0x76 [kernel] filename_lookup+0xc2 [kernel] vfs_statx+0x8c [kernel] __se_sys_newlstat+0x4c [kernel] do_syscall_64+0x5f [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 1032192 bytes in 126 allocations from stack __kmalloc_node_track_caller+0x187 [kernel] __kmalloc_node_track_caller+0x187 [kernel] __kmalloc_reserve.isra.0+0x2d [kernel] __alloc_skb+0x87 [kernel] __netdev_alloc_skb+0x3c [kernel] rt2x00queue_alloc_rxskb+0x49 [kernel] rt2x00lib_rxdone+0x75 [kernel] rt2x00usb_work_rxdone+0x74 [kernel] process_one_work+0x1d1 [kernel] worker_thread+0x4a [kernel] kthread+0xfb [kernel] ret_from_fork+0x22 [kernel] 2838528 bytes in 693 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] __do_page_cache_readahead+0xa7 [kernel] ondemand_readahead+0x198 [kernel] filemap_fault+0x266 [kernel] ext4_filemap_fault+0x2d [kernel] __do_fault+0x38 [kernel] __handle_mm_fault+0xde9 [kernel] handle_mm_fault+0xce [kernel] __do_page_fault+0x244 [kernel] do_page_fault+0x33 [kernel] page_fault+0x1e [kernel] 8175616 bytes in 1996 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] __do_page_cache_readahead+0xa7 [kernel] filemap_fault+0x388 [kernel] ext4_filemap_fault+0x2d [kernel] __do_fault+0x38 [kernel] __handle_mm_fault+0xde9 [kernel] handle_mm_fault+0xce [kernel] __do_page_fault+0x244 [kernel] do_page_fault+0x33 [kernel] page_fault+0x1e [kernel] 27226112 bytes in 6647 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] alloc_pages_vma+0x7d [kernel] __handle_mm_fault+0xe61 [kernel] handle_mm_fault+0xce [kernel] __do_page_fault+0x244 [kernel] do_page_fault+0x33 [kernel] page_fault+0x1e [kernel] $ sudo sh -c 'sync && free && echo 3 > /proc/sys/vm/drop_caches && sync && free' total used free shared buff/cache available Mem: 6046652 368412 5223572 3392 454668 5436692 Swap: 0 0 0 total used free shared buff/cache available Mem: 6046652 367680 5485580 3392 193392 5443648 Swap: 0 0 0 # only about 7 megabytes of RAM were missing after killing the glxgears