什么是node.js内存故障? [英] What's the node.js memory breakdown?

查看:85
本文介绍了什么是node.js内存故障?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在部署Node.js应用程序.这个应用程式似乎比应该消耗更多的RSS记忆体.因此,我们开始深入研究,并发现了以下内容,这要归功于process.memoryUsage();

We are deploying a Node.js application. This app seems to be consuming way more RSS memory than it should. So we started to dive into things and we found the following, thanks to process.memoryUsage();

  • RSS内存迅速增长到约400MB,并在400MB-500MB的范围内保持稳定,并有小起伏(垃圾收集器正在运行?)

  • The RSS memory grows quickly to about 400MB and stays more or less stable in a 400MB-500MB, with small ups and small downs (Garbage collector running?)

heapUsed迅速增长到50MB,然后保持在该级别(介于20MB和100MB之间).

The heapUsed quickly grows to 50MB and then stays at that level (between 20MB and 100MB).

堆总大小总是比使用的堆大30MB.

The heaptotal is always about 30MB more MB than the heapUsed.

如您所见,堆和RSS之间存在巨大差异,这是我认为我们应该重点关注的地方.我们的堆中似乎没有任何非常显着的泄漏.

As you see there is a huge difference between the heap and the RSS, which is where I think we should focus. There doesn't seem to be any very significant leak in our heap.

现在,RSS中没有堆中的内容是什么?我相信C扩展名和Buffers对不对?如果是这样,我们该如何调试.我们还要寻找什么?

Now, what's in RSS that is not in the heap? I believe C extensions, and Buffers, right? If so, how can we debug that. What else should we look for?

推荐答案

不知道您的应用程序在做什么,就无法对此发表评论.

Without knowing what your app is doing, it is impossible to comment on this.

如果V8堆的使用率明显低于RSS,那么可以,它必须是非V8对象使用的外部缓冲区和其他内存.

If the V8 heap usage is significantly lower than the RSS, then yes, it must be external buffers and other memory used by non-V8 objects.

您可以公开一些代码吗?

Can you make some code public?

这篇关于什么是node.js内存故障?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆