I have a loop in my code that generates many byte[] arrays (around 1 to 2 MB each), fills them with data, and then discard the reference. So, even though the reference is only held for a short time, I can see the private working set growing.
Now, if I try to allocate a large array (~ 400 MB) after the loop, could I get an out of memory exception? Or will the allocation force the GC to collect the transient data?
Thanks!