![pmap 显示“其他对象”的映射 - 我如何找出这些对象是什么?](https://linux22.com/image/221998/pmap%20%E6%98%BE%E7%A4%BA%E2%80%9C%E5%85%B6%E4%BB%96%E5%AF%B9%E8%B1%A1%E2%80%9D%E7%9A%84%E6%98%A0%E5%B0%84%20-%20%E6%88%91%E5%A6%82%E4%BD%95%E6%89%BE%E5%87%BA%E8%BF%99%E4%BA%9B%E5%AF%B9%E8%B1%A1%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F.png)
我正在调查我的 Rust 应用程序中的某种内存泄漏。内存保持稳定增长(从 30M 左右开始,每天增长 50M)。该应用程序是用 Rust 编写的,它几乎只是将 XDP/BPF 程序附加到一些接口,并通过 BPF 映射读取一些数据并发布一些指标。
有趣的是,“泄漏”仅发生在我们的测试环境中(到目前为止,生产环境中的内存使用情况非常稳定)。
下面是一些 pmap 输出(我已经过滤掉了*.so
,anon_inode:[perf_event]
因为有很多,它们不是问题的一部分)。
看看这个,我的泄漏似乎不在堆上(所以分析堆没有意义)。我想了解其他对象的未命名映射是什么,因为它们似乎在增长(请参阅 参考资料>>>
)。
我可以使用任何想法或工具来找出占用此内存的内容吗?
Address Perm Offset Device Inode Size Rss Pss Referenced Anonymous LazyFree ShmemPmdMapped FilePmdMapped Shared_Hugetlb Private_Hugetlb Swap SwapPss Locked THPeligible Mapping
55f8470e2000 r-xp 00000000 fd:04 3145822 5820 4472 4472 4468 0 0 0 0 0 0 0 0 0 0 my-program-name
55f847891000 r--p 005af000 fd:04 3145822 368 368 368 368 368 0 0 0 0 0 0 0 0 0 my-program-name
55f8478ed000 rw-p 0060b000 fd:04 3145822 12 12 12 12 12 0 0 0 0 0 0 0 0 0 my-program-name
55f848a15000 rw-p 00000000 00:00 0 132 108 108 108 108 0 0 0 0 0 0 0 0 0 [heap]
>>> 7f14f8000000 rw-p 00000000 00:00 0 24140 20620 20620 20620 20620 0 0 0 0 0 0 0 0 0
7f14f9793000 ---p 00000000 00:00 0 41396 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1500000000 rw-p 00000000 00:00 0 132 12 12 12 12 0 0 0 0 0 0 0 0 0
7f1500021000 ---p 00000000 00:00 0 65404 0 0 0 0 0 0 0 0 0 0 0 0 0
>>> 7f1504000000 rw-p 00000000 00:00 0 55792 47976 47976 47976 47976 0 0 0 0 0 0 0 0 0
7f150767c000 ---p 00000000 00:00 0 9744 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1508000000 rw-p 00000000 00:00 0 65496 52136 52136 52080 52136 0 0 0 0 0 0 0 0 0
7f150bff6000 ---p 00000000 00:00 0 40 0 0 0 0 0 0 0 0 0 0 0 0 0
7f150c000000 rw-p 00000000 00:00 0 132 36 36 36 36 0 0 0 0 0 0 0 0 0
7f150c021000 ---p 00000000 00:00 0 65404 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1510000000 rw-p 00000000 00:00 0 65484 62776 62776 62776 62776 0 0 0 0 0 0 0 0 0
7f1513ff3000 ---p 00000000 00:00 0 52 0 0 0 0 0 0 0 0 0 0 0 0 0
7f15172de000 ---p 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
7f15172df000 rw-p 00000000 00:00 0 2048 20 20 20 20 0 0 0 0 0 0 0 0 0
7f15176f3000 rw-p 00000000 00:00 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1517b0a000 rw-p 00000000 00:00 0 24 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1517b13000 ---p 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1517b14000 rw-p 00000000 00:00 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1517b16000 ---p 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1517b17000 rw-p 00000000 00:00 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1517b19000 ---p 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1517b1a000 rw-p 00000000 00:00 0 2048 20 20 20 20 0 0 0 0 0 0 0 0 0
7f1517eeb000 ---p 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1517eec000 rw-p 00000000 00:00 0 2048 56 56 56 56 0 0 0 0 0 0 0 0 0
7f15180ec000 ---p 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
7f15180ed000 rw-p 00000000 00:00 0 2048 56 56 56 56 0 0 0 0 0 0 0 0 0
7f1518696000 rw-p 00000000 00:00 0 16 16 16 16 16 0 0 0 0 0 0 0 0 0
7f1518df8000 rw-p 00000000 00:00 0 16 4 4 4 4 0 0 0 0 0 0 0 0 0
7f1519665000 rw-p 00000000 00:00 0 12 12 12 12 12 0 0 0 0 0 0 0 0 0
7f1519ae1000 ---p 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1519ae2000 rw-p 00000000 00:00 0 28 16 16 16 16 0 0 0 0 0 0 0 0 0
7f1519ae9000 ---p 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1519aea000 rw-p 00000000 00:00 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1519aec000 ---p 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
7f1519aed000 rw-p 00000000 00:00 0 16 8 8 8 8 0 0 0 0 0 0 0 0 0
7f1519af3000 rw-p 00000000 00:00 0 4 4 4 4 4 0 0 0 0 0 0 0 0 0
7ffd52d94000 rw-p 00000000 00:00 0 132 32 32 32 32 0 0 0 0 0 0 0 0 0 [stack]
7ffd52ddd000 r--p 00000000 00:00 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 [vvar]
7ffd52de0000 r-xp 00000000 00:00 0 8 4 0 4 0 0 0 0 0 0 0 0 0 0 [vdso]
ffffffffff600000 r-xp 00000000 00:00 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 [vsyscall]
====== ====== ====== ========== ========= ======== ============== ============= ============== =============== ==== ======= ====== ===========
455904 193740 191239 193668 184644 0 0 0 0 0 0 0 0 0 KB