如何正确识别和纠正服务器上的内存泄漏?

时间:2017-01-04 15:34:15

标签: linux memory-leaks linux-kernel

我们使用64Gb的RAM运行debian服务器来运行大型python模拟。

我们遇到的问题是大量的这种记忆被使用,我们不知道为什么或如何纠正。

它似乎不是缓存/缓冲区事物:

function(a) {
            var b = I.referrer;   //I equals documents
            if (/^https?:\/\//i.test(b)) {	//check if b.referrer is a page
                if (a) return b; // "A" is the value to force to always send the referer
                a = "//" + I.location.hostname;	//extract the actual location
                var c = b.indexOf(a);
                if (5 == c || 6 == c)
                    if (a = b.charAt(c + a.length), "/" == a || "?" == a || "" == a || ":" == a) return;
              //if this is not the same, return null, in other hands returns the referral domain
                return b
            }

运行smem时,它告诉我们几天后,内核动态内存最多分配37 Gb。

free -m
             total       used       free     shared    buffers     cached
Mem:         64454      56243       8211         20          6        113
-/+ buffers/cache:      56122       8332
Swap:        21051       5834      15217

我们昨天重新启动了服务器,并且在启动时显示内核动态内存为1.5 Gb,它会慢慢增加。

24小时后,它已达到17Gb

Area                           Used      Cache   Noncache
firmware/hardware                 0          0          0
kernel image                      0          0          0
kernel dynamic memory         36.8G     431.0M      36.4G
userspace memory               4.5G     149.7M       4.4G
free memory                   21.6G      21.6G          0
----------------------------------------------------------
                              62.9G      22.2G      40.8G

任何想法如何进一步调查,如果这确实是内存泄漏,我们该怎么办? (内核是3.16)

提前致谢

0 个答案:

没有答案