Viddesh
Viddesh

Reputation: 441

node.js memory usage issue

I have created https server using https module. When I hit the server with the requests and run the 'top' command, I can see the memory usage goes on increasing with the subsequent requests. After the server becomes idle the memory usage does't go down, it remains constant as maximum used. If I hit another bunch of transactions again it goes on increasing and stays at same size. Is this a normal behaviour of Node.js or there is a memory leak issue in my code?

Upvotes: 0

Views: 145

Answers (1)

Sachacr
Sachacr

Reputation: 732

The garbage collector is not called all the time because he block your process. So V8 launch GC when he think it's necessary. So your memory is increasing because the GC has not been fired yet. You can read this article to learn about the GC management of V8 : https://strongloop.com/strongblog/node-js-performance-garbage-collection/

Upvotes: 1

Related Questions