title: Test memory consumption
body: <p>I need to verify how much memory a specific function consumes during execution, and make sure that it stays under a specific limit.</p>
  
  <p>Ideally I'd like to do this in a test or benchmark. As far as I can see the only way to do this is to create a separate test binary and use the <code>BenchmarkResult</code> from</p>
  
  <pre><code>func Benchmark(f func(b *B)) BenchmarkResult
  </code></pre>
  
  <p>Is this the correct way to do this?</p>