OutOfMemoryException within WriteableBitmap

Memory profiling for .NET developers

OutOfMemoryException within WriteableBitmap

Postby andyste1 » Tue May 13, 2014 9:05 am

I'm currently evaluating ANTS Memory Profiler 8 in order to investigate an issue that some of our customers are having with our WPF application. The app renders a lot of charts (several hundred, using a 3rd-party library), with repeated re-rendering of the charts each time the user performs a particular action in the UI. After a number of iterations of this, the app falls over with an OutOfMemoryException within the constructor of the WriteableBitmap class.

I've tried ANTS on one of the machines in question, but it never reports any LOH fragmentation, although I noticed the "Free space on LOH" went down to 1Mb in one of the snapshots. There doesn't appear to be any memory leaks between snapshots, and the memory usage reported in Task Manager never really climbs (it'll jump slightly every time it renders the charts, but drops again shortly afterwards, presumably due to GC).

I'm at a loss as to where to look next, and not even sure if ANTS will be able to help in this scenario due to the problem being somewhere within the WriteableBitmap class (which I believe is known to have memory management issues). It could even be something deep down in GDI? Stranger still, I've not been able to reproduce on my PC - it's a similar spec to the customer's, but mine has a graphics card.

Given that I spotted just 1Mb free in the LOH, I was wondering how big is the LOH? Does it increase dynamically as the app needs more space, or is it of a fixed size? Is this small number even an issue, given that ANTS reported <1% fragmentation?

Any suggestions as to what I can try next?
Posts: 1
Joined: Tue May 13, 2014 8:56 am

Postby Chris.Allen » Wed May 14, 2014 3:17 pm

You're welcome to send your saved profiler results in to us at support@red-gate.com where we will elucidate everything that the profiler has discovered.

Please include : "tickets/19614" in the subject of any email
Posts: 579
Joined: Thu Mar 12, 2009 4:17 pm

Return to ANTS Memory Profiler 8

Who is online

Users browsing this forum: No registered users and 0 guests