简体   繁体   English

RSS内存增加,而Node.js中的堆稳定

[英]RSS memory increases while heap is stable in Node.js

I've got a node.js application that supporting React server rendering with communicating internal server API. 我有一个node.js应用程序,它通过与内部服务器API的通信来支持React服务器渲染。 BTW, application's RSS memory is increasing gradually. 顺便说一句,应用程序的RSS内存正在逐渐增加。

I've been troubleshooting for 5 days now and already checked comparison of heap dump. 我已经进行了5天的故障排除,并且已经检查了堆转储的比较。 But heap was stable. 但是堆是稳定的。 Only RSS was increasing. 只有RSS在增加。

2017-06-29 09:10:00 083: memoryUsage { rss: 107597824, heapTotal: 78532608, heapUsed: 68423584 }
2017-06-29 09:10:00 212: memoryUsage { rss: 107163648, heapTotal: 78532608, heapUsed: 67970768 }
2017-06-29 09:10:00 377: memoryUsage { rss: 106213376, heapTotal: 77484032, heapUsed: 67166800 }
2017-06-29 09:10:00 448: memoryUsage { rss: 106184704, heapTotal: 78532608, heapUsed: 62869512 }
....
....
2017-06-30 15:25:00 144: memoryUsage { rss: 140972032, heapTotal: 78532608, heapUsed: 65703576 }
2017-06-30 15:25:00 379: memoryUsage { rss: 135626752, heapTotal: 74338304, heapUsed: 64624224 }
2017-06-30 15:25:00 396: memoryUsage { rss: 139800576, heapTotal: 78532608, heapUsed: 66888688 }
2017-06-30 15:25:00 699: memoryUsage { rss: 140886016, heapTotal: 77484032, heapUsed: 67736488 }
2017-06-30 15:25:00 926: memoryUsage { rss: 142073856, heapTotal: 78532608, heapUsed: 67849096 }

At first, I thought that it causes from many client requests. 起初,我认为这是由许多客户请求引起的。 However, today, I met huge traffic in short term. 但是,今天,我在短期内遇到了巨大的流量。 BTW, the RSS memory is not increased as much as traffic. 顺便说一句,RSS内存的增加不如流量大。 It was strange. 真奇怪

I really wanna fix this issue. 我真的想解决这个问题。 How and what should I do more? 我应该如何做些什么?

Node.js version: 6.9.4
OS: RHEL 6.8

Memory Usage 内存使用情况 在此处输入图片说明

Network Input 网络输入 在此处输入图片说明

if you're making http requests with keepAlive and a timeout, try a newer node. 如果要通过keepAlive和超时发出HTTP请求,请尝试使用较新的节点。 There was a memory leak that affected v6.8 and v6.9, fixed in 6.10 (see https://github.com/nodejs/node/pull/9440 ) 内存泄漏影响了6.10版中修复的v6.8和v6.9(请参阅https://github.com/nodejs/node/pull/9440

Edit: actually, if I remember right, that also affected heapUsed, not just rss. 编辑:实际上,如果我没记错的话,那也影响了heapUsed,而不仅仅是rss。

Could you be leaking buffers? 您会泄漏缓冲区吗? Buffers are not on the heap, but do increase rss. 缓冲区不在堆上,但会增加rss。

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

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