I have a wpf application that is leaking memory...is there a way to detect and fix these leaks using just visual studio without using any of the profiling tools? Or are there any free ones that I could use to detect and fix them? Thaks
            Asked
            
        
        
            Active
            
        
            Viewed 9,420 times
        
    2
            
            
        - 
                    5how did you know it is leaking memory ? – Shyju Jun 12 '12 at 18:06
- 
                    I run the application, open up a few windows with controls, close them ... the memory in the task manager just keeps up...I tried to programmitcally call GC.Collect()..at different points...that dosent clean up the controls... – user1202434 Jun 12 '12 at 18:07
- 
                    Since .NET is managed it shouldn't leak - although you can't be sure when the GC will kick in – m.edmondson Jun 12 '12 at 18:09
- 
                    1Be sure to call `Dispose` on any disposable objects. Also understand that explicitly calling `GC.Collect()` doesn't necessarily mean that the GC will run right then and there. – doogle Jun 12 '12 at 18:10
- 
                    1possible duplicate of [Memory leaks in wpf C#](http://stackoverflow.com/questions/6154810/memory-leaks-in-wpf-c-sharp) – sloth Jun 12 '12 at 18:10
- 
                    I would avoid calling GC.Collect() also. Let .net manage that for you. – tsells Jun 12 '12 at 23:44
- 
                    Look at these SO question's for profiling tools and yes most of the tools have free trial period - http://stackoverflow.com/questions/399847/net-memory-profiling-tools and http://stackoverflow.com/questions/1312493/net-code-profiling-tools?rq=1 – akjoshi Jun 13 '12 at 06:21
3 Answers
1
            Scitech's memory profiler has a free trial period and is an excellent tool for investigating memory consumption issues.
 
    
    
        Ian Mercer
        
- 38,490
- 8
- 97
- 133
 
     
     
    