2

The question is how to force Windows 7 to REMOVE items from my RAM when they are no longer in use.

Because this question is met with 100% resistance I'm going to clarify this once...

This question is NOT the opposite, not why I should buy more memory, not why I should kill my SSD with a pagefile because it's not 1985 and 16K doesn't cost five grand, it's not about why I should leave files in memory that clearly aren't being used and it is NOT a debate of any kind. With that out of the way on to competent computing...

I just starting playing Elder Scrolls Online and with 8GB of RAM, disabled pagefile and disabled Superfetch there should be no reason why 2GB from ESO and 1GB from Firefox should mean I've run out of RAM. Windows 7 is VERY clearly leaving items in memory even though I've EXPLICITLY disabled the Superfetch service.

Example: using RamMap I see that after clearing out all the memory there is still a 111 megabytes are currently being used by a movie file I watched for dinner three nights ago...not WHY but HOW do I prevent Windows from mindlessly wasting RAM like this?

In other words how do I force Windows to unload files from the RAM when the programs that were using them have themselves been closed? Please only answer if you plan to not deviate from my VERY clearly defined question. Windows is it's own problem when it complains I'm low on RAM when I have plenty and it's just wasting it.

12
  • 1
    Be aware that "out of memory" errors might be triggered by low virtual address space (i.e. memory maps for device and RAM). Video cards with a lot of VRAM can require a big chunk of this system-reserved block. This is different than the sorts of RAM usage you are hoping to avoid.
    – horatio
    Commented Apr 15, 2014 at 20:11
  • 1
    @techie007 Windows keeps warning me I'm low on memory while it sits there wasting it. I don't want things in memory if I've closed them, that is how a computer should work. Superfetch and the idea that it's SUPPOSED be is to preload things (e.g. load a game when it's launcher is opened) but Windows itself is doing this and it's completely obvious it is at best oblivious and most likely intentionally incompetent to boost RAM sales where manufacturers are making razor thin margins.
    – John
    Commented Apr 15, 2014 at 20:45
  • 6
    There's a difference between preloading thing (SuperFetch) and caching things you've previously use (regular Windows caching). anyhow, you just seem to want to rant instead of figuring out what's broken about your computer (I never get out of memory warning unless something is broken or misconfigured, and I've used windows for decades now), so I'll leave you to it. Good luck! Commented Apr 15, 2014 at 21:01
  • 4
    You have probably run out of memory because you have disabled the pagefile.
    – kinokijuf
    Commented May 20, 2014 at 12:34
  • 2
    The real solution to fix your "out of memory" warnings is to enable your pagefile. Your SSD will be fine, unless it's complete crap.
    – Bigbio2002
    Commented May 20, 2014 at 14:29

5 Answers 5

4

You are using a "unsupported"1 configuration of windows, I do not think there is anything built in to expose to the userland level that can flush the file cache.

I think your only option is going to be to write a custom program2 that can have more direct access to the windows cache manager and will be able to flush those buffers. You will likely need to use undocumented API calls so you will not be guaranteed that your program will not break across windows updates3.

If I was going to do it the place I would start is with the book "Windows Internals" by Mark Russinovich4 and read chapter 11 "Cache Manager" to see which internal API calls Windows is making.


1. Not that you can't use it, it is just windows itself and programs written for windows are not written with your configuration as a consideration as a limitation.
2. Or find a program that has been written allready.
3. It is highly unlikely that it will break, it will more likely break across major windows versions, but a windows update does have a small chance to break it too.
4. The same person who made RamMap

1
  • I'm accepting this answer for now though if someone has a program and posts the information I'll accept that answer instead should one be posted. What you said makes sense and you didn't go off-topic so also +1.
    – John
    Commented Apr 17, 2014 at 1:18
1

Try RamMap - empty Standby list

RamMap - empty Standby list

1
  • 1
    I use this program now, especially after restarting Firefox since that is when I try to clear memory without a brutal-blow to my productivity with an unnecessary reboot. I empty everything and watch the Task Manager for roughly how much RAM is relieved. The last three items on the empty file menu release the most though may "freeze" the system for a moment or two (heads up to those who also think page files are a relic of the 20th century).
    – John
    Commented May 18, 2017 at 11:33
0

You may not like this answer but... create a small pagefile. Doesn't even matter where you put it (SSD is best though, and no, you won't kill your SSD anytime soon) since with that much RAM it won't be used all that much (you certainly shouldn't notice anything if everything is working properly) but it should solve your issue.

If that doesn't work, something is wrong with your setup. With 8gb of RAM and tons of applications in the background with a computer that is on 24/7 I never had "out of memory" issues with ESO (or anything else for that matter, but I of course do have a pagefile)

0

Every file that's no longer in use by a program is moved to the "Standby" part of the memory. And that applies to the files of ESO as well.

There's a program around that can collapse the "Standby" part of the memory. See this thread: http://forum.sysinternals.com/rammap-empty-standby-list_topic27297_post132769.html Add the program to Task Scheduler and you're done.

Windows keeps track of files you open/use e.g. in "Recent documents". E.g. that movie you watched. Solution: Clean every day the "C:\prefetch" folder and "Recent documents" (with e.g. Piriform's Ccleaner).

Install PcWinTech's Cleanmem. It reduces memory usage.

You can enable the swapfile with an SSD installed but then you need to use a symbolic link to redirect datatraffic to & from the swapfile to another drive. http://blog.superuser.com/2011/05/10/maximizing-the-lifetime-of-your-ssd/

There seems to be a bug in Windows' memory management. In some special cases Windows refuses to release memory from the "Standby" part of the memory. When programs ask for more memory they won't get it from the "Standby" memory. Then the user will get into trouble. e.g. compuiter crashes.

0

I ran in to the same problem in a VMware vSphere environment, where Windows VM with small amounts of RAM (1GB) would have relatively large amounts of memory used for cache, which would trigger VM memory usage alarms in vCenter. The following tool can be wrapped in to a scheduled task to periodically empty the standby list among other things.

https://wj32.org/wp/software/empty-standby-list/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .