My Application is using 5 GB to 6 GB of memory. We have run IIS debug diagnostics, and it shows the following:
GdiPlus.dll is responsible for 2.49 GBytes worth of outstanding allocations. The following are the top 2 memory consuming functions:
GdiPlus!GpMemoryBitmap::AllocBitmapData+c2: 2.47 GBytes worth of outstanding allocations.
GdiPlus!EpScanBitmap::Start+212: 6.79 MBytes worth of outstanding allocations.
This was detected in w3wp.exe_Projectname-2_PID_28824_Date__03_10_2012__Time_03_15_14PM_457_Leak Dump – Private Bytes.dmp
what is causing this leak? This is due to brushes.
Please give some idea/ or how to solve this?
Thanks in advance.
You’re probably forgetting to release GDI handles (bitmaps, brushes, pens, etc). Most GDI objects implement
IDisposable, and you should always call theDisposemethod when you’re done using these objects. Theusingstatement can help with that: