Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to identify memory leaks in c#? [duplicate]

Tags:

c#

Possible Duplicate:
Anatomy of a “Memory Leak”

Hi All what are the best practices for identifying memory leak in c#?

like image 339
santosh singh Avatar asked Nov 29 '10 17:11

santosh singh


People also ask

How do you detect memory leak in C?

We know that a program should call couple of malloc/calloc and same number of free calls. If the number of malloc/calloc calls are greater than number of free calls then we are sure a memory leakage happened. So the way to detect memory leak is to trace the calls.

Which method is used to detect memory leak?

Enable Profiling. Java profilers are tools that monitor and diagnose the memory leaks through the application. They analyze what's going on internally in our application, like how we allocate memory. Using profilers, we can compare different approaches and find areas where we can optimally use our resources.

What causes a memory leak in C?

Memory leaks occur when new memory is allocated dynamically and never deallocated. In C programs, new memory is allocated by the malloc or calloc functions, and deallocated by the free function. In C++, new memory is usually allocated by the new operator and deallocated by the delete or the delete [] operator.


1 Answers

How about

ANTS Memory Profiler™: Profile the memory usage of your .NET application

ANTS Performance Profiler for optimizing your .NET code

Memory Leak Detection in .NET

like image 60
Adriaan Stander Avatar answered Oct 15 '22 13:10

Adriaan Stander