Memory's nodejs application is increase for long time



  • Hi nodejs developer,
    I is beginer nodejs, I have deployed nodejs application to centos server. The first time, memory is 6MB, but after long time is increase very very high and cause full memory.
    I try free object by way set variable to null, but I see it don't improve for memory.
    How do you release and manager memory in nodejs application?
    Please help me!

    NHAN NGUYEN

    0


  • I can't help you with just the provided information. Anyway, you can use memwatch for detecting memory leaks.



  • Hi tresdin,
    I use expressjs for my app. The first time, memory is 6MB, but after 1 month, it's increase to 400-500MB and can continue increase. memwatch show memory leak but I don't solution to resolve it. Do you get same issue as me? Do you way manager nodejs memory?

    NHAN NGUYEN

    0


  • You need to find out the leaks yourself via retrieving memory differnce before and after the suspected processes are executed. If you have no suspected processes, then you have to test every single methods in your application. The built-in method process.memoryUsage() will provide some information about the memory usage at the current execution point.



  • @tresdin
    Thanks @tresdin , I'm trying it. I will comment result later. :)

    NHAN NGUYEN

    0


  • do you use Nginx on server ?.



  • Hi @Quốc-Cường I don't use Nginx. Do you detect what in this issue?

    NHAN NGUYEN

    0


  • For modules of a framework, it would work well. Because it has normally been stress tested by community. You should focus on custom modules handling application logic, especially the objects which is created and passed around application. It is still referenced by app-level variable and it could not be cleaned up.

    papa elf

    0


  • @nguyenquynhan No cache and use nodejs for serve-static resource make nodejs raise memory fast.


Log in to reply