Title: Is there any way to see the leaked memory of C# application?
Tags: c#;wpf;winforms;memory-leaks
Question: I have an application with different Components like Windows Media Player, Image box etc. All components are playing back to back or one after another. And a user controller with a Panel as parent it contains 5 Grids and a Grid is combination of 4 Labels. And a form the same user controller has 2 instance with a video and a image.
Due to this in every second my application increase its committed memory size by 2MB. After some time my application stopped due to out of memory. So I want to see in which part or component the memory leaked.
Is there any freeware software to monitor the memory leak?

Here is the accepted answer: To monitor if there's a memory leak in .NEE, you can just use Windows Performance Monitor. From this article: Identify And Prevent Memory Leaks In Managed Code:
Use PerfMon to examine the following performance counters for the application: Process/Private Bytes, .NET CLR Memory/# Bytes in All Heaps, and .NET CLR LocksAndThreads/# of current logical Threads. The Process/Private Bytes counter reports all memory that is exclusively allocated for a process and can't be shared with other processes on the system. The .NET CLR Memory/# Bytes in All Heaps counter reports the combined total size of the Gen0, Gen1, Gen2, and large object heaps. The .NET CLR LocksAndThreads/# of current logical Threads counter reports the number of logical threads in an AppDomain. If an application's logical thread count is increasing unexpectedly, thread stacks are leaking. If Private Bytes is increasing, but # Bytes in All Heaps remains stable, unmanaged memory is leaking. If both counters are increasing, memory in the managed heaps is building up.
Another tool to track download memory leaks is: DebugDiag. It is very effective, and also free.

Here is another answer: I advise you to use CLR Profiler, it's free and freely distributable application:
The primary function of CLR Profiler is to enable you to understand how your application interacts with the managed, garbage-collected heap. Some of the more important things that you can investigate include:
Who allocates what on the managed heap.
Which objects survive on the managed heap.
Who is holding on to objects.
What the garbage collector does over the lifetime of your application.
For more information, see this link:
How To: Use CLR Profiler
Comment for this answer: thanks @Anatoliy it looks like good but i run my application overnight.in the morning the clr profiler has a pup up saying close the program and the clr command prompt saying out of memory

Here is another answer: You may try out Coverity. They find defects that includes:
Memory Corruption
Crashes
Security Vulnerabilities
Concurrency
Uninitialized memory
Error handling
Resource leaks
You may find more here.
Comment for this answer: It's freeware software?
Comment for this answer: thanks @Wasif in Coverity i have to upload my application to the website.Am I right @Wasif?

Here is another answer: Next to ANTS or EQATEC you also have JetBrains dotTrace.
Also if you don't want to use a profiler, you could go through your code and look for disposable objects. Every disposable object should be disposed off when it's usage came to an end.
In most cases if you've disposed of all your objects in a correct way you won't have memory leaks anymore.
One case where you might continue to have an out of memory exception is when you are multi threading and you create more tasks than that can be processed in a certain amount of time.

Here is another answer: "If you suspect there is a user-mode memory leak but are not sure which process is causing it, you can use Performance Monitor to measure the memory usage of individual processes."
See http://msdn.microsoft.com/en-us/library/windows/hardware/ff560134(v=vs.85).aspx
Comment for this answer: thanks for reply i spent some time to use Performance Monitor from this i am able to get the overall memory graph from my application

Here is another answer: Use a memory profiler, like ANTS Memory Profiler or EQATEC

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 6, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:04/07/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><wpf><winforms><memory-leaks>', 'Title': 'Is there any way to see the leaked memory of C# application?', 'ViewCount': 476, 'id': 22911884, 'user_AboutMe': None, 'user_AccountId': None, 'user_DisplayName': None, 'user_Reputation': None, 'user_Views': None, 'user_id': None}}