Simple method of allocating exact amount of RAM
See the question and my original answer on StackOverflowI would prefer to use unmanaged memory, like this:
IntPtr p = Marshal.AllocCoTaskMem(X);
Sleep(Y);
Marshal.FreeCoTaskMem(p);
Otherwise the CLR garbage collector may play tricks on you.