Skip to content

JohnnyBravo75/MemoryWatchDog

Repository files navigation

MemorySpy - free and open-source Memory Profiler for .NET

Watch your memory profile it and find leaks

Why

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.

Pros

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)

Usage

As watchdog

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));

On demand

Use the GUI and profile on demand and dig through the objects

About

memory profiler for .NET applications. Create snapshots (heap,threads) and analyse/ compare them

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors