We need checks for controlling memory usage.
There are two possible data sources:
-
whole process usage as per kernel report (Linux)
-
allocator statistics (userspace); this is expected to be much faster to retrieve and more precise and have more info (e.g. also number of allocations/frees, also per-thread?) than the data from the kernel.
And there are two possible logging approaches:
a. as linear log (to a separate file?) via polling, e.g. every 10 ms
b. log as part of probes
Approach b requires an efficient data source. Retrieving from the Kernel is about 150x slower than retrieving the real time (which is also via the kernel); thus that would necessitate to do the memory collection statistically in many places--either use EVOBENCH_SCOPE_EVERY and have all timings be statistical, but then many EVOBENCH_SCOPE probes would have to be changed to _EVERY; or do the memory collection at (yet) a lower frequency than the rest. Neither solution is very palatable. It appears that probes are best combined with a userspace data source.
So, the most sensible approach is to:
-
implement whole process usage (from Kernel) via polling now.
-
implement probe based collection via allocator statistics later.
Tackling step 1 now.
We need checks for controlling memory usage.
There are two possible data sources:
whole process usage as per kernel report (Linux)
allocator statistics (userspace); this is expected to be much faster to retrieve and more precise and have more info (e.g. also number of allocations/frees, also per-thread?) than the data from the kernel.
And there are two possible logging approaches:
a. as linear log (to a separate file?) via polling, e.g. every 10 ms
b. log as part of probes
Approach b requires an efficient data source. Retrieving from the Kernel is about 150x slower than retrieving the
realtime (which is also via the kernel); thus that would necessitate to do the memory collection statistically in many places--either useEVOBENCH_SCOPE_EVERYand have all timings be statistical, but then manyEVOBENCH_SCOPEprobes would have to be changed to_EVERY; or do the memory collection at (yet) a lower frequency than the rest. Neither solution is very palatable. It appears that probes are best combined with a userspace data source.So, the most sensible approach is to:
implement whole process usage (from Kernel) via polling now.
implement probe based collection via allocator statistics later.
Tackling step 1 now.