How would one go about keep an object in memory such that it won't be paged out by the OS in .Net?
i.e. Something similar to VirtualLock, but operating on an object, such that if compacting occurs and the object is moved it still would not be paged out, etc.. (I suppose one could pin the object's, determine what pages it belongs to, and then VirtualLock those pages, but that seems non-desireable for many reasons.)
If possible, could you point me to a reference or working sample? (C# ideally)
Many thanks in advance!