I wrote a WPF application, targeting .NET 4.5.2 64-bit. It runs on Windows 8.1 Professional 64-bit.
The application is used to record multiple videos simultaneously. Because the video encoder's speed can vary greatly during operation, I make some very large arrays of byte arrays in memory (totalling 6 GiB), which is enough for me to buffer 40 seconds of video, and I let the encoding happen on a separate thread, so I don't risk getting blocked by the encoding and miss incoming frames from the cameras.
I have read somewhere that (byte) arrays are lazily allocated in .NET - i.e. just writing byte[] foo = new byte[1024*1024]; does not mean that 1 MiB is immediately allocated; the memory is not actually allocated until the first access. Though I can't find where I read that anymore. Anyhow, knowing that, I make sure to call Array.Clear() on my arrays, which should force them to be immediately allocated. I also need to make sure the buffer stays in RAM at all times, so I have disabled the page file altogether.
But for some reason, it seems that either the .NET runtime or Windows is still doing something crazy: right after initializing my byte arrays and calling Array.Clear() on all of them, I could see in Task Manager that 7.4 GiB is in use. And it sat there until I pressed the "Record" button, at which point I started to have real data to fill the buffers with. And the strange thing is, the In Use memory started to drop to about 3.6 GiB, and then slowly climbed back to 7.4 GiB. At no point did my application discard and reallocate arrays. Also keep in mind that because I have disabled the page file, there is no place for Windows to page out to.
What is going on? How should I interpret this weirdness?

VirtualLock