Node: Memory leak version 10.16.0

Created on 4 Jun 2019  路  7Comments  路  Source: nodejs/node

  • Version: 10.16.0
  • Platform: Linux Debian

After upgrade from 10.15.3 to 10.16.0 (with same code base) we have been experiencing an increase of memory usage together with CPU time.

memory v10.x

Most helpful comment

We are also experiencing OOM errors with this combination (Jenkins + Jest + Node 10.16.0), reverting the node version resolves the issue.

All 7 comments

Is there any chance you can provide more information? Knowing how the result of process.memoryUsage() changed could be a good starting point. If the major difference is the heap size, then taking a heap dump using e.g. Chrome DevTools or the heapdump module on npm (which can then be inspected in Chrome) might provide more data.

What I can provide are 2 heapdumps, that were generated in a controlled environment with a small stress test.

The first one is with the version 10.15.3 and the other one is with 10.16.0

https://gist.github.com/reisraff/49bc262681e45ad35409c9b9e3f3a9b9

I also can provide this 2 images:

After day 29 we had upgraded the version.

Memory Usage

Process time

The memory leaks in node 10.16.0 are causing our Jenkins builds that are running unit tests under Jest to OOM.

I wish I could provide more information, but I am a simple build admin, not a JavaScript person.

We are also experiencing OOM errors with this combination (Jenkins + Jest + Node 10.16.0), reverting the node version resolves the issue.

comparing the heapdumps in https://github.com/nodejs/node/issues/28063#issuecomment-498852534 , one potential focus area is 89 extra module objects present in the second dump. Many things (strings, arrays, objects, closures, etc.) can be seen as increased in the second one, but my gut-feeling is that those are stemmed from the increase in modules.

  • did we take the dump from identical / same program?
  • did we take the dump at identical load / time sequence?

if so, then it would imply that there are some code that takes different control flow based on node.js version. can you perform a wide search in the code base (including modules) for usage of process.version or process.versions?

did we take the dump from identical / same program?
did we take the dump at identical load / time sequence?

These 2 dumps are from the same app, the time sequence idk, I received it from the devops team.

can you perform a wide search in the code base (including modules) for usage of process.version or process.versions?

Yeah, I could do, but I should do a app downgrade, since I have made some improvements in the code base in order to avoid memory overhead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cong88 picture cong88  路  3Comments

vsemozhetbyt picture vsemozhetbyt  路  3Comments

willnwhite picture willnwhite  路  3Comments

sandeepks1 picture sandeepks1  路  3Comments

stevenvachon picture stevenvachon  路  3Comments