Currently I am running one .exe I causes memory leakage issue. So I want to know how we could know which variable or process is responsible for this issue
can we know which are the variable/ that are causeing memory leakage issue in running exe in c# .net
Asked
Active
Viewed 73 times
0
-
Hi, what you mean saying memory leakage? How did you spot this? – Christos Apr 28 '15 at 09:51
-
in task bar it showing the usage of memory. – user3138879 Apr 28 '15 at 09:52
-
Use memory profiler, like dotTrace or RedGate Memory profiler – oleksii Apr 28 '15 at 10:00
-
Just because a .Net program uses more and more memory doesn't necessarily imply that there's a memory leak. Maybe it's just optimizing use of the PC's memory and not being agressive in doing garbage collection. So unless you're getting "out of memory" errors you may just be observing normal behavior. – RenniePet Apr 28 '15 at 11:16
-
It just increasing day by day if we run 24*7 – user3138879 Apr 28 '15 at 11:29
1 Answers
4
I recommend getting a good memory profiler. I've used Redgate ANTS in the past. It is very good. JetBrains dotMemory is an alternative to this. If you need to profile your application then there are lots of options. A good profiler should be able to tell you what objects are growing over time

Community
- 1
- 1

oliveromahony
- 471
- 4
- 19
-
-
Depends on what you consider "third party tools". Windows offer windbg for this kind of thing but needs an install https://msdn.microsoft.com/en-us/windows/hardware/hh852365 and CLR profiler: https://www.microsoft.com/en-us/download/details.aspx?id=14727 but these are more difficult to use. You could also do something like this: http://www.dotnetfunda.com/articles/show/625/best-practices-no-5-detecting-net-application-memory-leaks. Visual Studio may have something built in, depending on the version you are using. – oliveromahony Apr 28 '15 at 10:14
-
Another alternative would be to write code. You can use the garbage collector dotted around your code to check memory increases before/after certain calls - https://msdn.microsoft.com/en-us/library/xe0c2357(v=vs.110).aspx to see where the memory grows overtime. This is a little more time consuming imo – oliveromahony Apr 28 '15 at 10:18
-
1@user3138879: I assume you are referring to the fact that you have so far posted 14 questions and zero answers here at SO? – RenniePet Apr 28 '15 at 12:30
-
1"So I want to know how we could know which variable or process is responsible for this issue" - I tried to give you at least 5 different ways to figure this out. If you would have liked more clarity or had a specific idea in mind, I suggest you rephrase the question. – oliveromahony Apr 28 '15 at 13:05