Fix histogram memory issues.
Before we had buckets of 5 micro second size. For a 100 MS GC
this used at least 16 * (100 / .005) bytes of storage inside of the
histogram data structure. If you consider the 3 different GC types,
and each timing logger having its own histogram its easy to see
how memory used was significant.
We now have an upper bound on the number of buckets (default 100).
When we hit the upper bound we simply combine adjacent buckets
together. This reduces the total number of buckets by a factor of
2, while increasing the bucket size by a factor of 2. This means
that we may lose a slight amount of precision, but the confidence
intervals remain nearly as useful.
Total unknown memory (occam-svelte):
Before: 45648 kB:
After: 33304 kB
There are probably still some additional optimizations which can be
done as disabling histograms altogether reduces the memory used by
A bit of other cleanup in image_space.cc and dlmalloc_space.cc.
6 files changed