FormidableLabs/nodejs-dashboard

Memory leak

forz13 opened this issue · 8 comments

  • Node Version: Node v6.9.1
  • Package version: v0.1.1
  • Platform: SMP Debian 3.2.81-1 x86_64 GNU/Linux
    When I required this package, the memory began to grow slowly
    const dashboard = require("nodejs-dashboard");
    Memory schedule
    deepinscreenshot-5958
    Comparison of 2 heap shapshots
    0740fd1b21

Thanks for filing this issue @forz13. Can you provide a little more detail? From the graph above it appears that memory is decreasing over time. Each telemetry event will create a new string to hold the data. I might be able to optimize this by writing to a reusable buffer instead.

Yes, the amount of free memory decreases slowly over time, and I agree with you about the use of reusable buffers in place of strings

To clarify is this 1) overall system memory or 2) utilization by a specific process, say: node or dashboard?

1 - It's available RAM at OS. I have't now memory schedule for node process, but I am sure that the RAM is reduced due increasing memory usage by node process

@forz13, do you know about how much data is going out to stdout or stderr? It would have to be almost 2k/sec to be the sole issue here (looks like about a 200mb drop in 27hrs). Currently, the app is buffering all the stdout and stderr so they can be viewed in the windows. We probably need to cap this.

@forz13 can you try rerunning with 0.2.1? We published some changes that should address these issues.

@jasonwilson thank you, i will try it and give the graphics in the next few days

Closing for now. Feel free to reopen if the issue isn't resolved.