Wednesday, March 22, 2017

Empty/dump modified memory to pagefile in windows


I use process hacker to clear out a few gigs of ram before loading large files such as 2GB stack traces so that everything does not freeze up for an hour as stuff gets swapped back and forth. However process hacker only empties about 200mb at a time.


Are there any programs or windows APIs that lets me empty a few gigs of modified memory to the pagefile at a time?


Answer



The process hacker author provides the source code. Look into the sourcecode and you can find that memlists.c provides what you want:


command = MemoryFlushModifiedList;
status = NtSetSystemInformation(
SystemMemoryListInformation,
&command,
sizeof(SYSTEM_MEMORY_LIST_COMMAND)
);


Code a simple C CLI tool which runs this command.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...