CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Is there any free tool to detect memory leak in C#?

  1. #1
    Join Date
    Jul 2005
    Posts
    1,030

    Is there any free tool to detect memory leak in C#?

    In C# memory leak doesn't happen often. But when it happens, then it is really hard to find out. Please recommend a free tool for me to detect the memory leak in C# application. Thanks.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,277

    Re: Is there any free tool to detect memory leak in C#?

    Depending on your Visual Studio edition, there is c# profiler built-in.

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,277

    Re: Is there any free tool to detect memory leak in C#?

    As far as memory leaks go, be sure to wrap objects that implement IDisposable in using blocks.

    Code:
    using (var myObj = new ObjThatImplementsIDisposable())
    {
      // use obj
      myObj.DoWork ();
    }
    Last edited by Arjay; June 13th, 2015 at 11:09 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)