WPF Memory Leak Problem. Memory stable with small documents, but grows until OOM exception with large documents.
Background:
We've developed a WPF application for controlling a dynamic display. There is a Design component, where the user lays out the display document, and a document Display component.
Elements in the display can contain text and/or graphics. Each element can cycle through different strings or images using various transitions--scrolling, fading, flashing, etc.
Problem:
The problem is with an element displaying graphics, with a cross-fade between different graphics. The fade is accomplished by animating the opacity property of two WPF image controls (one for incoming, one for outgoing).
Everything works fine as long as the total memory footprint of the application while running is below a (not yet precisely defined) threshold. When the total foot print increases (for example, by adding another graphic element with a large graphic) then the total memory used by the application begins to grow, and I'm eventually presented with an OOM exception. The large graphic on its own, or the fading graphics on its own do not have the memory leak problem, but only the combination.
Has anyone else seen similar behavior? Any ideas for a solution? I'm guessing that the problem has something to do with Large Object Heap fragmentation, but this is only a guess.
Unfortunately, I don't have sample code to post as this is part of a larger solution. I will try to create a sample app that illustrates this behavior and update my post.