OutOfMemory exception in ants memory profiler

uffeuffe Posts: 3

I'm trying to profile a website but i either keep getting aspnet_wp errors, or after upgrading to latest released (from this forum) i'm getting OutOfMemory exceptions in ants memory profiler program.
It seems to happen when the profiler reaches 1 gigabyte of memory consumption, is there any way to increase that figure or is there a workaround?


  • The OutOfMemory problem is caused by a limitation in ANTS Memory Profiler. Once the profiled application uses more than a certain amount of memory, taking a snapshot will cause an OutOfMemoryException.

    There is no precise limit to how much memory ANTS Memory Profiler can cope with - it depends on the type of objects in memory. But it is about 500mb to 700mb - typically about 600mb. Adding, or removing, physical memory from your machine won't change this limit.

    On an x64 machine I've found you can profile a program that uses 4Gb of memory with no issues. We will be making a new memory profiler for H1 2009 that will deal with these memory limitations.

    If these OutOfMemory exceptions occur when your application is using a small amount of memory (say, 100mb), then this is probably a different problem.
    Jason Crease
    Red Gate Software
  • The problem typically happens when aspnet_wp reaches around 700mb but it does that after the second reload of the frontpage, which makes it impossible to debug the website properly, normally it reaches 200-300 mb without running the profiler, so i'm guessing that a lot of debug info is injected into the process?
  • Say ASPNET_WP uses 200mb of memory without the profiler attached. When the profiler is attached, and no snapshot is being taken, it will use around 500mb - since it is storing information about every object allocation.

    When you take a snapshot, ASPNET_WP will briefly use up around 800mb as the object data is extracted and piped across to ANTS Memory Profiler (AMP). The memory usage of ASPNET_WP should then return to 500mb.

    In AMP, each snapshot will use roughly 4 times the as much memory as the size of the memory being used by ASPNET_WP - so about 4 x 200mb = 800mb. So you can probably take about 2 snapshots before AMP exceeds the 2GB limit.
    Jason Crease
    Red Gate Software
Sign In or Register to comment.