First, you must determine whether you have a leak managed memory leaks or internal memory:
Use these PerfMon counters for this:
- Process / private bytes
- Memory .NET CLR / # Bytes in all heaps
- .NET CLR LocksAndThreads / # of current logical thread.
If 1 is increasing, but remains stable 2, you have a memory leak. If 1 and 2 are increased, you have a leak managed memory.
If 3 suddenly increases, stacks drain flows.
If you find a leak managed memory, you will .NET profiling tools like Ants, YourKit etc. Since they do not help in your case, you probably have a leak.
Important. Be sure to call the collector manually garbage before looking at memory usage. If the memory pressure is not enough, the GC will not work, and the memory of your process increases (which is not a leak in this particular case.) Causes the GC as follows:
GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect();
user128300
source share