NodeJS: Why pm2 list shows memory keeps on increasing?

前端 未结 1 1594
闹比i
闹比i 2021-02-10 10:17

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.

1条回答
  •  离开以前
    2021-02-10 10:53

    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?

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

    1. 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.

    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 w/o seeing the code I can't say this for sure

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

    0 讨论(0)
提交回复
热议问题