I have a math application needs memory upto 128 megabytes. VC starts memory swap (page fault) after 56 megabytes. I have 256 megabytes RAM installed. Some one told me to use VirtaulLockto prevent page fault. I checked the MSDN. But it is not clear to use it with malloc() function.