Add docs on Memory profiling (#1217). (#1319)
diff --git a/docs/user_guide.md b/docs/user_guide.md index b86ef43..919e0f0 100644 --- a/docs/user_guide.md +++ b/docs/user_guide.md
@@ -50,6 +50,8 @@ [Custom Statistics](#custom-statistics) +[Memory Usage](#memory-usage) + [Using RegisterBenchmark](#using-register-benchmark) [Exiting with an Error](#exiting-with-an-error) @@ -1051,6 +1053,21 @@ ->Arg(512); ``` +<a name="memory-usage" /> + +## Memory Usage + +It's often useful to also track memory usage for benchmarks, alongside CPU +performance. For this reason, benchmark offers the `RegisterMemoryManager` +method that allows a custom `MemoryManager` to be injected. + +If set, the `MemoryManager::Start` and `MemoryManager::Stop` methods will be +called at the start and end of benchmark runs to allow user code to fill out +a report on the number of allocations, bytes used, etc. + +This data will then be reported alongside other performance data, currently +only when using JSON output. + <a name="using-register-benchmark" /> ## Using RegisterBenchmark(name, fn, args...)