简体   繁体   English

如何在linux中找到系统内存泄漏?

[英]How do I find a system memory leak in linux?

I've got a monolithic piece of software, a game on a basic linux kernel, that seems to leak memory in swap space.我有一个单一的软件,一个基于基本 linux 内核的游戏,它似乎在交换空间中泄漏内存。 The memory usage of the process itself is reported as constant over a day or so but the free memory on the system is consistently decreasing until there is no more physical ram space.进程本身的内存使用情况在一天左右的时间内报告为恒定,但系统上的可用内存一直在减少,直到没有更多的物理内存空间。 There is no other software running other than the standard X server and debian system daemons.除了标准的 X 服务器和 debian 系统守护进程之外,没有其他软件在运行。 There are many usb devices connected that use libusb.连接了许多使用 libusb 的 USB 设备。

This is not a typical new/delete leak.这不是典型的新建/删除泄漏。

I'm at a loss as to where to look for system resources that are consumed and not freed.我不知道在哪里寻找已消耗但未释放的系统资源。 It's not OpenGL, all allocated OGL memory is freed and I see that in the logs.这不是 OpenGL,所有分配的 OGL 内存都已释放,我在日志中看到了这一点。 Is it possible for the driver to be misbehaving outside of the process though?但是,驱动程序是否有可能在流程之外行为不端?

So basically the question is, what kinds of resources can be used by a program that when not released will continue to leak system memory even after the program has exited?所以基本上问题是,程序可以使用哪些类型的资源,即使在程序退出后不释放也会继续泄漏系统内存?

Possible item: I've read in places that mmap, when used incorrectly can leak system memory.可能的项目:我读过 mmap 的地方,如果使用不当会泄漏系统内存。 But the places where that is used in this software are not being run in this test case.但是在这个测试用例中没有运行在这个软件中使用的地方。

After quite a few tests the issue was definitively caused with a previous version of NVidia's graphics driver leaking kernel memory.经过多次测试,问题最终是由以前版本的 NVidia 图形驱动程序泄漏内核内存引起的。 An upgrade solves the issue.升级解决了这个问题。 For anyone interested, the leaky version was: 343.36 / running on 750Ti对于任何感兴趣的人,泄漏版本是:343.36 / 在 750Ti 上运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM