質問

I'm running a Node.JS web application that works fine for a few hours and then at some random point in time, the V8 heap suddenly starts growing very quickly without a reason and about 40 minutes later, this growth usually stops and the process continues running normally.

I'm monitoring this with nodetime:

What could be the cause of this? Is it a memory leak in my program or perhaps a bug in V8?

役に立ちましたか?

解決

There is no way of knowing what the issue by what you provided, but there's a 99.99% chance the problem is inside / fixable in your code.

The best tools I've found for debugging memory issues with Node.js is https://github.com/bnoordhuis/node-heapdump, you can set it up to dump a certain intervals, or by default it listens to USR2 signal, so you can send kill -s USR2 to the pid of your process and get the snapshot.

Then you can use Chrome Inspector to load the heap into it's profiling tool and start inspecting.

I've generally found the issues to be around holding on to external requests too long.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top