What are the challenges you face when working across database platforms? Take the survey

Out Of Memory Exception

Hi All,

I would like to know whether there is anyone who can help me on this please.

I started up the profiler OK, took a snapshot straight away. Then, run through some script on the page for 10 mins. When I tried to take another snapshot, save the results or save the profiler , it throws me the error below:

Unable to save profiler results - exception details System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.ArrayList.set_Capacity(Int32 value)
at System.Collections.ArrayList.EnsureCapacity(Int32 min)
at System.Collections.ArrayList.Add(Object value)
at _7._1(Byte[] )
at _8._1(Object )
at _8._1(ObjectInfo )
at _23._1(_8 )
at _23._1(ArrayList )
at RedGate.Profiler.Engine.Memory.MemoryResults.SaveToDisk(String fileName)
at _5._3(IProfilerResults )

For more information, see Help and Support Center at

I have about 81GB of hard disk free and 10GB RAM avaliable.

Look forward to hearing from you.

Thanks in advanced.



  • Options
    Hi Lawrence,

    No matter how much free RAM you've got, the size of the array list is limited by the number of elements you can store in an Int32 and the maximum amount of memory you can use in your process. On a Win32 system, that is 2GB, although the allocation algorithm used by the .NET garbage collecter typically sees heap exhaustion at around 1.5GB in my experience.

    There is a possibility that you may not be able to get the results that you need unless you cut down the length of time you spend profiling the application or take snapshots more frequently.
Sign In or Register to comment.