Every so often I see “Speed Up Your PC” programs that offer a RAM cleaning feature.
They claim to defrag and free up unused memory like a garbage collector or something… not sure.
Here are some examples:
http://www.softpedia.com/get/Tweak/Memory-Tweak/Clean-Ram.shtml
http://download.cnet.com/Instant-Memory-Cleaner/3000-2086_4-10571833.html
http://www.uniblue.com/software/speedupmypc/
I’m interested in learning about the Win32 C API’s that they are using, if anyone has knowledge.
I’ve heard about the ProcessIdleTasks() in advapi32.dll trick, but doesn’t look too legit looking at the documentation on that function.
If you really insist on doing this, you could enumerate processes, open a handle to each, and call
SetProcessWorkingSetSize(process_handle, -1, -1);for each (but you really don’t want to do this).