# Can I limit the number of timings stored by MiniProfiler (for .NET)?

**URL:** <https://community.miniprofiler.com/t/can-i-limit-the-number-of-timings-stored-by-miniprofiler-for-net/653>\
**Category:** .NET\
**Created:** [March 31, 2022, 8:46pm UTC](https://community.miniprofiler.com/t/can-i-limit-the-number-of-timings-stored-by-miniprofiler-for-net/653 "2022-03-31T20:46:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fustercluck](https://avatars.discourse-cdn.com/v4/letter/f/b3f665/32.png) [@fustercluck](https://community.miniprofiler.com/u/fustercluck)\
**Post date:** [March 31, 2022, 8:46pm UTC](https://community.miniprofiler.com/t/can-i-limit-the-number-of-timings-stored-by-miniprofiler-for-net/653/1 "2022-03-31T20:46:22Z")

</div>

Hi,

Duplicating a unanswered question from StackOverflow in the hope that it might get an answer here:

I’m using MiniProfiler in a .NET core app to time various stages in a 30 FPS video pipeline. This is a long-running executable, and memory used for Timing instances seems to grow without limit – unsurprisingly since a new Timing instance is created each time Step() is called.

In total about 2 GB of memory was consumed by MiniProfiler objects in one long test.

Is there any way to limit the number of Timings recorded, and say keep only the last N?

Failing that, I wonder how folks are able to use MiniProfiler in production; is there another way to avoid this issue? Or is it simply not targeted at use-cases like this (with perhaps 150 timings recorded per second)?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![elizabethtaylor](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@elizabethtaylor](https://community.miniprofiler.com/u/elizabethtaylor)\
**Post date:** [November 23, 2026, 9:03am UTC](https://community.miniprofiler.com/t/can-i-limit-the-number-of-timings-stored-by-miniprofiler-for-net/653/2 "2026-11-23T09:03:27Z")

</div>

MiniProfiler is built around a profiling session/request, not a rolling metrics buffer: Step() appends to the current profiler’s timing list, and I don’t think there’s a built-in cap on child timings within one profiler. For an always-on 30 FPS pipeline, I’d either start/stop a profiler per frame or short window and plug in a bounded custom storage implementation, or keep MiniProfiler for occasional diagnostic windows while using lightweight counters/histograms or a ring buffer for continuous timing. That avoids retaining every Timing instance.
