Finding memory leak

前端 未结 4 1376
情深已故
情深已故 2021-02-02 03:11

I have a web application that I wrote using a lot of different 3rd party components, a CMS and of course my code. For some reason I get out of memory exception.

4条回答
  •  粉色の甜心
    2021-02-02 03:46

    When it comes to fixing memory leaks there are two steps.

    1. Finding where the memory leak is.
    2. Fixing the memory leak.

    Normally the first step is tricky. So, I would recommend to go ahead with ANTS memory profiler and first find what exact instances are growing.

    Profiling an ASP.NET application on IIS

    In your question you have shown the class list result which includes even classes with system namespace. To clean up the noise, you can select "Show Only Classes with source" option.

    Then follow the follwing steps.

    1. Take a base snapshot before you perform any operations.
    2. Perform the operations you suspect that have memory leaks.
    3. Take couple of more snapshots until you get a fairly stable snapshot.
    4. Compare the last snapshot with the base and see what instances are growing.

提交回复
热议问题