title: Node js memory keep rising
body: <p>I have application (sending messages to endpoints) running on Node-Js
  for time to time I need to restart the application in order to clean
  &quot;heapUsed&quot;</p>
  <p>but if I run Garbage collector manually (global.gc()) I see it's clean the memory
  but while Garbage collector run automatically its not (the &quot;heapUsed&quot; keep rising)</p>
  <p>I add --trace_gc --trace_gc_verbose node param to insure GC run automatically and found to following log:</p>
  <pre><code>...
      [49366]   548769 ms: Scavenge 54.0 (163.5) -&gt; 39.0 (163.5) MB, 5.5 ms [allocation failure].
      [49366] Memory allocator,   used: 167396 KB, available: 1331740 KB
      [49366] New space,          used:    681 KB, available:  15702 KB, committed:  32768 KB
      [49366] Old pointers,       used:  22615 KB, available:  63597 KB, committed:  92601 KB
      [49366] Old data space,     used:  12236 KB, available:  11704 KB, committed:  24378 KB
      [49366] Code space,         used:   3335 KB, available:   2564 KB, committed:   5976 KB
      [49366] Map space,          used:   1027 KB, available:   5010 KB, committed:   6174 KB
      [49366] Cell space,         used:     17 KB, available:     98 KB, committed:    128 KB
      [49366] PropertyCell space, used:     26 KB, available:     37 KB, committed:     64 KB
      [49366] Large object space, used:      0 KB, available: 1330699 KB, committed:      0 KB
      [49366] All spaces,         used:  39939 KB, available:  98715 KB, committed: 162089 KB
      [49366] External memory reported:   -299 KB 
  ...
  </code></pre>
  <p>I also use Node js <a href="https://www.npmjs.com/package/gc-heap-stats" rel="nofollow noreferrer">gc-heap-stats</a> and <a href="https://www.npmjs.com/package/gc-profiler" rel="nofollow noreferrer">gc-profiler</a>
  to insure GC is running and found is run also for Scavenge and Marksweep algorithm</p>
  <p>I monitor
  freemem  using <code>OS.freemem()</code>
  totalmem using <code>OS.totalmem()</code>
  memUsage using <code>process.memoryUsage()</code>
  result look like this:</p>
  <pre><code>  &quot;freemem&quot;: 509698048,
    &quot;totalmem&quot;: 17179869184,
    &quot;memUsage&quot;: {
      &quot;rss&quot;: 281284608,
      &quot;heapTotal&quot;: 212272640,
      &quot;heapUsed&quot;: 184643248
    }
  </code></pre>
  <p>After running Garbage collector <strong>manually</strong> (with global.gc()):</p>
  <pre><code>  &quot;freemem&quot;: 443863040,
    &quot;totalmem&quot;: 17179869184,
    &quot;memUsage&quot;: {
      &quot;rss&quot;: 276410368,
      &quot;heapTotal&quot;: 207112960,
      &quot;heapUsed&quot;: 57413400
    }
  </code></pre>
  <p>I also take heapdump before and after check it with chrome dev tool and found no conclusions about any memory leak or strange behavior</p>
  <p>so why memory keep rising?</p>