Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent an object from being paged out (VirtualLock equivalent)

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-desirable for many reasons.)

If possible, could you point me to a reference or working sample? (C# ideally)

like image 757
Gene Avatar asked Sep 25 '09 16:09

Gene


1 Answers

Have you looked at this one http://www.codeplex.com/NonPagedCLRHost ?

like image 178
Andrey Taptunov Avatar answered Sep 21 '22 20:09

Andrey Taptunov