Watch your memory profile it and find leaks
Memory leaks can be tricky to find (very rare occurrences during the night, high memory spikes, etc.), and in such cases, you may not be able to attach a memory debugger, or you are too late. They also take complete memory snapshots with hundreds of MB, which can increase memory pressure even more.
Can be integrated directly (just include the MemoryWatchDog.dll) Does not suspend the target process and can easily be used in live production environments Can periodically clean/defragment the Large Object Heap (LOH) and potentially solve some memory issues Can create automatic snapshots based on a filter (e.g., when memory exceeds a specific limit) Can capture only small/fast aggregated snapshots (for a first glimpse)
Integrate the MemoryWatchDog.dll into your application and let it clean your memory or write snapshots on demand (when filter matches)
var memWatchDog = new MemoryWatchDog
{
MinMemoryCleanupLimitBytes = 100000,
WriteMemStatsFile = true,
MemStatsFilter = new MemoryStatsFilter
{
AggregateObjects = true,
MinObjectCount = 10,
ExcludeNameSpaces = new List<string> { "System.", "Microsoft." }
}
};
memWatchDog.StartWatching(new TimeSpan(0, 30, 0));
Use the GUI and profile on demand and dig through the objects



