Memory Leaks in ASP.NET

Discussion in 'ASP .Net' started by Guest, Mar 4, 2005.

  1. Guest

    Guest Guest

    In my ASP.NET application, we are noticing appreciable memory leaks and the
    main culprit appears to be System.String We use ResourceReader to read in a
    resource file and we close and dispose the resourcereader object also. We
    profiled the application using .NET Memory profiler and it appears that
    garbage collection does not appear to be happening. Even after closing all
    sessions memory for aspnet process remains pegged at the level it was.
    Has anyone run across a similar situation? Any ideas would be greatly
    Guest, Mar 4, 2005
    1. Advertisements

  2. Guest

    Scott Allen Guest

    So the application leaks? Or it stays at a farily predictable 'high
    water' mark?
    Scott Allen, Mar 4, 2005
    1. Advertisements

  3. Guest

    Homam Guest

    Homam, Mar 4, 2005
  4. Guest

    Guest Guest

    Thanks to both of you for your replies.
    at one of our client sites the application virtually became unusable pegging
    the memory over 800 MB. In our tests with .NET Memory profiler the culprit
    appears to be System.String when used with ResourceReader. Our tests also
    indicated that even after all the sessions are closed the aspnet memory
    remained high and never came down even after about 6 hours.
    Guest, Mar 4, 2005
  5. Guest

    Mark Rae Guest

    You mean this one:

    Can you recommend it? Is anyone else using it? Is there a better utility out
    Mark Rae, Mar 4, 2005
  6. Guest

    Josh Guest

    Its not likely to be the fault of the string. I bet its the Reader not
    cleaning up. Try killing the reader.
    Josh, Mar 4, 2005
  7. Guest

    Guest Guest

    We in fact Close,Dispose and even set the reader to null.
    Guest, Mar 4, 2005
  8. Guest

    Guest Guest

    Yes. We used the same one. I am not aware of something better than this.
    Guest, Mar 4, 2005
  9. I agree with Josh. System.String is not going to cause any memory leaks. If
    you abuse it, it can run your memory up quite a bit, but it will come back
    down. On the other hand, ResourceReader is a disposable class that works
    with files. Not closing and/or disposing such a class can cause a memory

    Now, I know that you've stated that you close and dispose the
    ResourceReader, but are you sure that you always do so? For example, is the
    close and dispose in a Finally block of a Try/Catch block? If not, an
    exception might prevent the ResourceReader from being disposed properly.

    You might want to look for any other classes that expose unmanaged objects,
    particularly classes that work with File IO.


    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    What You Seek Is What You Get.
    Kevin Spencer, Mar 4, 2005
  10. Guest

    david youren Guest

    I have a similar problem with a memory leak in .net on a dual xeon
    windows 2003 server. I notice a lot of posts about this leaks on a dual
    xeon, what is your server running?
    david youren, Mar 11, 2005
  11. Guest


    May 28, 2009
    Likes Received:


    we are also facing the problem of memory leak. actually this is because of the infragistics tools for I am also using .net Memory Profile but since I new to this tool, need some resources which could give me insite of the tool. the resouces/material/samples available on the .net memory profiler's site are for win App.

    will appreciate if you could provide something regarding this.
    sanjeevsai, May 28, 2009
  12. Guest


    Nov 7, 2012
    Likes Received:
    Asp.Net Web Profiler

    I only recently dicovered the Asp.Net Web Profiler. It is simply amazing in how you can analize in memory data. It displays the cache data, application state data and objects, all active user sessions and al session state data in each session with drill down functionality to browse through data and analyze everything.
    mias, Nov 7, 2012
  13. Guest


    Nov 7, 2012
    Likes Received:
    Web Profiler

    If there are still something running in memory you should be able to detect it by running the web profiler. You can download for free from
    mias, Mar 17, 2013
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.