0

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

user3138879
  • 183
  • 2
  • 9

1 Answers1

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
  • Any other option other than third party tools – user3138879 Apr 28 '15 at 10:06
  • 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