admin管理员组

文章数量:1287957

I am using HAPI.JS framework with NodeJS and created a proxy. Think that proxy means i am just maintaining session in redis. Other than that i am not doing anything in the code. May be only thing is i am using setInterval to log my process.memoryUsage() for every 3 mintues.

My Questions:

  1. Why my Memory Keeps on Increasing?
  2. Will it get down?
  3. Is this occurs due to setInterval keeps on logging the process usage?
  4. Is this occurs due to console logging of every request and response?
  5. My Redis Database is kept open till my server crashes, it this causes this ?
  6. Do i need use process mananger like new relic or strong loop to identify this?
  7. So how long this memory will keep on increasing, at some point it must stop (i want to know which point is that?)
  8. I am using sequelize of MSSQL transaction using pooling concept? Does pooling makes this?

P.S I am new to node JS.

I am using HAPI.JS framework with NodeJS and created a proxy. Think that proxy means i am just maintaining session in redis. Other than that i am not doing anything in the code. May be only thing is i am using setInterval to log my process.memoryUsage() for every 3 mintues.

My Questions:

  1. Why my Memory Keeps on Increasing?
  2. Will it get down?
  3. Is this occurs due to setInterval keeps on logging the process usage?
  4. Is this occurs due to console logging of every request and response?
  5. My Redis Database is kept open till my server crashes, it this causes this ?
  6. Do i need use process mananger like new relic or strong loop to identify this?
  7. So how long this memory will keep on increasing, at some point it must stop (i want to know which point is that?)
  8. I am using sequelize of MSSQL transaction using pooling concept? Does pooling makes this?

P.S I am new to node JS.

Share Improve this question asked Apr 17, 2015 at 7:27 SathishSathish 2,1903 gold badges27 silver badges45 bronze badges 4
  • could you show your code - sounds like it isn't that much. – Philipp Kyeck Commented Apr 17, 2015 at 10:54
  • @pkyeck Sorry mate. it is not possible to show my code.This is my implementation, list of routes, each route call another server and serves that response to the client. I am using request module to call another server. All my routes are protected by token based authentication. – Sathish Commented Apr 17, 2015 at 12:01
  • Your app is leaking memory but w/o seeing the sourcecode it's impossible to say why. You can try to follow these steps to find the leak: github./felixge/node-memory-leak-tutorial – Philipp Kyeck Commented Apr 17, 2015 at 12:06
  • @pkyeck Can you tell me y that is happening from list of above questions. – Sathish Commented Apr 17, 2015 at 12:10
Add a ment  | 

1 Answer 1

Reset to default 9
  1. Why my Memory Keeps on Increasing?

You got a memory leak

  1. Will it get down?

Sometimes GC kicks in and cleans up some things (that are not leaking)

  1. Is this occurs due to setInterval keeps on logging the process usage?
  2. Is this occurs due to console logging of every request and response?

Usually not, but w/o seeing the code I can't say this for sure

  1. My Redis Database is kept open till my server crashes, it this causes this ?

Should not be a problem.

  1. Do i need use process mananger like new relic or strongloop to identify this?

It is one way to do it ... but there are also others (see link below).

  1. So how long this memory will keep on increasing, at some point it must stop (i want to know which point is that?)

Depends on the server setup. How much RAM + what else is running etc.

  1. I am using sequelize of MSSQL transaction using pooling concept? Does pooling makes this?

Usually not, but as I said before w/o seeing the code it is almost impossible to say this for sure

Maybe this post helps you find the leak:
https://www.nearform./blog/how-to-self-detect-a-memory-leak-in-node/

本文标签: javascriptNodeJS Why pm2 list shows memory keeps on increasingStack Overflow