marcominetti / node-memwatch

A NodeJS library to keep an eye on your memory usage, and discover and isolate leaks.
775 stars 63 forks source link

Add GC duration info #9

Open megastef opened 8 years ago

megastef commented 8 years ago

The modules gc-stats and gc-profiler provide the GC pause time. It would be interesting to have this in gc-memwatch too.

See e.g. https://github.com/dainis/node-gcstats/blob/master/src/gcstats.cc#L117 or https://github.com/bretcope/node-gc-profiler/blob/master/src/GcProfiler.cc#L86

So the GC time could get into this function https://github.com/marcominetti/node-memwatch/blob/master/src/memwatch.cc#L212

marcominetti commented 8 years ago

Nice hint, do you have time to work on a PR? Otherwise I'll add it my weekendlog...

megastef commented 8 years ago

Sorry, I wrote my last C++ program in 1998 :) - so I better don't touch. Background: I'm hunting for a growing number of GC cycles (without memory leak as far I see). I've got the impression that the gc got somehow more and more busy without beeing able to release memory (always nearly the same amount). So I wondered if it could be related to Node versions, or modules I use including gc-profiler and gc-stats. I wanted to compare results with memwatch-next as well :) Beside the missing feature I would be thankful for any good hint in that direction.

Ahh, one more thing - currently I count the number of GC runs (both types) and sum the GC time. The effect of more frequent GC runs makes also Event Loop Latency higher (in some cases).