mpl icon indicating copy to clipboard operation
mpl copied to clipboard

Better measurement and reporting of GC statistics

Open shwestrick opened this issue 5 years ago • 0 comments

We need to implement better memory management statistics. Much of the MLton GC library is MLton-specific and no longer relevant to MPL.

At the moment to measure GC, I've been relying on the functions GC_getLocalGCMillisecondsOfProc and GC_getPromoMillisecondsOfProc which are respectively imported into MLton.GC.Statistics as localGCTimeOfProc and promoTimeOfProc. These are implemented in terms of clock_gettime, measuring wall-clock time. If we want to distinguish user and system time (such as in the style of MLton.Rusage) then we will have to do something more careful, e.g. as discussed in #67.

Some desirable other things:

  • Bytes allocated.
    • Is this a per-processor measurement?
    • If not, then what is the best way to accurately measure it on-the-fly?
  • Bytes collected and promoted.
    • Is this a per-processor measurement?
  • Current total heap size.
    • Similar to bytes allocated, we want a reasonably accurate way of measuring it on-the-fly even while other processors are allocating, collecting, etc.
  • Current bytes live.
    • This is difficult to measure accurately without some sort of global synchronization?
    • Also measure maximum bytes live, so far.
  • Number of (local) GCs.

shwestrick avatar Jan 13 '20 19:01 shwestrick