$ sudo /usr/share/bcc/tools/memleak # (...) # (much spam while I launched 100 instances of glxgears, then killed them) # (...) [22:32:46] Top 10 stacks with outstanding allocations: 425984 bytes in 13 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] __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] 819200 bytes in 200 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] __change_page_attr_set_clr+0x115 [kernel] change_page_attr_set_clr+0x13c [kernel] _set_pages_array+0xf0 [kernel] ttm_set_pages_caching+0x1a [kernel] ttm_alloc_new_pages.isra.0+0xf5 [kernel] ttm_page_pool_get_pages+0x16d [kernel] ttm_pool_populate+0x144 [kernel] ttm_populate_and_map_pages+0x24 [kernel] ttm_tt_populate.part.0+0x1e [kernel] ttm_tt_bind+0x48 [kernel] ttm_bo_handle_move_mem+0x25f [kernel] ttm_bo_validate+0x124 [kernel] ttm_bo_init_reserved+0x25a [kernel] amdgpu_bo_do_create+0x19f [kernel] amdgpu_bo_create+0x43 [kernel] amdgpu_gem_object_create+0x97 [kernel] amdgpu_gem_create_ioctl+0x1ac [kernel] drm_ioctl_kernel+0xb8 [kernel] drm_ioctl+0x23d [kernel] amdgpu_drm_ioctl+0x49 [kernel] do_vfs_ioctl+0x43d [kernel] ksys_ioctl+0x5e [kernel] __x64_sys_ioctl+0x16 [kernel] do_syscall_64+0x5f [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 835584 bytes in 204 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] 1036288 bytes in 253 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] 1056768 bytes in 129 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] 2097152 bytes in 1 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] ttm_pool_populate+0x29f [kernel] ttm_populate_and_map_pages+0x24 [kernel] ttm_tt_populate.part.0+0x1e [kernel] ttm_tt_bind+0x48 [kernel] ttm_bo_handle_move_mem+0x25f [kernel] ttm_bo_validate+0x124 [kernel] ttm_bo_init_reserved+0x25a [kernel] amdgpu_bo_do_create+0x19f [kernel] amdgpu_bo_create+0x43 [kernel] amdgpu_gem_object_create+0x97 [kernel] amdgpu_gem_create_ioctl+0x1ac [kernel] drm_ioctl_kernel+0xb8 [kernel] drm_ioctl+0x23d [kernel] amdgpu_drm_ioctl+0x49 [kernel] do_vfs_ioctl+0x43d [kernel] ksys_ioctl+0x5e [kernel] __x64_sys_ioctl+0x16 [kernel] do_syscall_64+0x5f [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 4194304 bytes in 1024 allocations from stack kmem_cache_alloc+0x13a [kernel] kmem_cache_alloc+0x13a [kernel] __sigqueue_alloc+0x6a [kernel] __send_signal+0x2d9 [kernel] do_send_sig_info+0x52 [kernel] kill_pid_info+0x3b [kernel] it_real_fn+0x26 [kernel] __hrtimer_run_queues+0xf6 [kernel] hrtimer_interrupt+0x118 [kernel] smp_apic_timer_interrupt+0x81 [kernel] apic_timer_interrupt+0xf [kernel] perf_trace_buf_alloc+0x55 [kernel] perf_trace_kmem_free+0x70 [kernel] kfree+0x128 [kernel] __audit_syscall_exit+0x248 [kernel] syscall_slow_exit_work+0x10f [kernel] do_syscall_64+0x17c [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 7757824 bytes in 1894 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] ttm_alloc_new_pages.isra.0+0x9a [kernel] ttm_page_pool_get_pages+0x16d [kernel] ttm_pool_populate+0x1c6 [kernel] ttm_populate_and_map_pages+0x24 [kernel] ttm_tt_populate.part.0+0x1e [kernel] ttm_tt_bind+0x48 [kernel] ttm_bo_handle_move_mem+0x25f [kernel] ttm_bo_validate+0x124 [kernel] ttm_bo_init_reserved+0x25a [kernel] amdgpu_bo_do_create+0x19f [kernel] amdgpu_bo_create+0x110 [kernel] amdgpu_vm_init+0x193 [kernel] amdgpu_driver_open_kms+0x97 [kernel] drm_file_alloc+0x15b [kernel] drm_open+0xa7 [kernel] drm_stub_open+0xb1 [kernel] chrdev_open+0xaa [kernel] do_dentry_open+0x13c [kernel] path_openat+0x325 [kernel] do_filp_open+0xab [kernel] do_sys_open+0x199 [kernel] do_syscall_64+0x5f [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 120479744 bytes in 29414 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] 417333248 bytes in 199 allocations from stack __alloc_pages_nodemask+0x2b3 [kernel] __alloc_pages_nodemask+0x2b3 [kernel] ttm_alloc_new_pages.isra.0+0x9a [kernel] ttm_page_pool_get_pages+0x16d [kernel] ttm_pool_populate+0x144 [kernel] ttm_populate_and_map_pages+0x24 [kernel] ttm_tt_populate.part.0+0x1e [kernel] ttm_tt_bind+0x48 [kernel] ttm_bo_handle_move_mem+0x25f [kernel] ttm_bo_validate+0x124 [kernel] ttm_bo_init_reserved+0x25a [kernel] amdgpu_bo_do_create+0x19f [kernel] amdgpu_bo_create+0x43 [kernel] amdgpu_gem_object_create+0x97 [kernel] amdgpu_gem_create_ioctl+0x1ac [kernel] drm_ioctl_kernel+0xb8 [kernel] drm_ioctl+0x23d [kernel] amdgpu_drm_ioctl+0x49 [kernel] do_vfs_ioctl+0x43d [kernel] ksys_ioctl+0x5e [kernel] __x64_sys_ioctl+0x16 [kernel] do_syscall_64+0x5f [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] $ sudo sh -c 'sync && free && echo 3 > /proc/sys/vm/drop_caches && sync && free' total used free shared buff/cache available Mem: 6046652 819348 4752440 3428 474864 4984740 Swap: 0 0 0 total used free shared buff/cache available Mem: 6046652 390436 5444820 3428 211396 5419128 Swap: 0 0 0 # over 400 megabytes of RAM were missing, even after killing the glxgears # also, a huge Thank You to everybody here working on amdgpu, we appreciate!