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

OutOfMemoryException within WriteableBitmap

andyste1andyste1 Posts: 2
edited May 14, 2014 10:17AM in ANTS Memory Profiler 8
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?


Sign In or Register to comment.