We have an application which needs to be able to run for days. On startup, while some stuff is being initialized on a background worker, it displays a splash screen containing an indeterminate progress bar. That splash screen is a WPF Window, displayed using ShowDialog(). Once initialization is finished, the splash screen is closed, and the main application Window is displayed.
After having been running for a couple of days, the application crashes with OutOfMemoryException.
SOS showed no managed memory leak, but the memory usage of the (32-bit) application was more than 1.4GB which was abnormal. So it had to be unmanaged memory. A few WinDbg sessions later, it turns out that millions of 72 bytes allocations had been made, and they start from right after the splash screen closes. It's not always 72 bytes, the attached sample project, for example, leaks by 80-byte allocations on my computer.
Not setting IsIndeterminate to true on the progress bar fixed the memory leak.