You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time cilium/ebpf uses mmap(MAP_ANONYMOUS), it should give a name to the memory region indicating its purpose (i.e. ring buffer for a specific ebpf map).
Investigate why my application is using too much memory by looking at /proc/pid/maps.
Applications can allocate memory with mmap(MAP_ANONYMOUS) from various libraries. When investigating memory issues, I look at /proc/pid/maps. When the memory regions are anonymous, it is difficult to understand where the allocations are coming from. If cilium/ebpf was labelling the perf ring buffers and other mmap memory region, it would help me understand if I gave too much memory to my ebpf maps, or if the problem is in another library than cilium/ebpf.
Interesting, this could help with the new Map.Memory() API as well. Would be nice to see the names show up in pmap.
Unfortunately, this doesn't seem to work for mmapable bpf maps. Since https://lwn.net/Articles/913935, naming is supported for MAP_SHARED | MAP_ANON, but BPF maps already show up as anon_inode:bpf-map in /proc/self/maps, which likely falls outside of this category.
Suggestion
Every time cilium/ebpf uses
mmap(MAP_ANONYMOUS)
, it should give a name to the memory region indicating its purpose (i.e. ring buffer for a specific ebpf map).Use case
Investigate why my application is using too much memory by looking at /proc/pid/maps.
Applications can allocate memory with
mmap(MAP_ANONYMOUS)
from various libraries. When investigating memory issues, I look at/proc/pid/maps
. When the memory regions are anonymous, it is difficult to understand where the allocations are coming from. If cilium/ebpf was labelling the perf ring buffers and other mmap memory region, it would help me understand if I gave too much memory to my ebpf maps, or if the problem is in another library than cilium/ebpf.This requires:
xref inspektor-gadget/inspektor-gadget#3541 (comment)
cc @burak-ok
The text was updated successfully, but these errors were encountered: