Skip to content

This utility allows you to lock every available memory regions of an arbitrary process into its working set.

License

Notifications You must be signed in to change notification settings

0vercl0k/lockmem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lockmem

Builds

This utility allows you to lock every available memory regions of an arbitrary process into its working set. It uses ntdll!NtLockVirtualMemory (syscall used internally by VirtualLock) to lock memory ranges as well as GetProcessWorkingSetSizeEx and SetProcessWorkingSetSizeEx to increase the size of the process' working set.

The Windows kernel guarantees that those pages will stay resident in memory, not written to the pagefile and not incur a page fault on access.

lockmem

Build

(base) c:\lockmem\src>nmake

Microsoft (R) Program Maintenance Utility Version 14.26.28806.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        if not exist ..\bin mkdir ..\bin
        cl /O1 /nologo /ZI /W3 /D_AMD64_ /DWIN_X64 /sdl /Fe..\bin\lockmem.exe lockmem.cc /link /nologo /debug:full ntdll.lib
lockmem.cc
        del *.obj *.pdb *.idb
        if exist .\bin del bin\*.exp bin\*.ilk bin\*.lib

(base) c:\lockmem\src>..\bin\lockmem.exe
./lockme <process name | pid>

About

This utility allows you to lock every available memory regions of an arbitrary process into its working set.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published