memory - Why does Windows 7 x64 take so much RAM after closing all the RAM intensive programs?

06
2014-04
  • Nick

    I have 32GB RAM and I run a Windows 7 x64 OS.

    When I start the PC, it uses ~1.5GB RAM.

    I crank it up(with software, mostly browsers and scripts, over a period of certain days, while the PC is not restarted) up to 20-25GB of RAM.

    The I decide to close everything, and maintain only the software that starts with Windows(firewall, AV, etc) and I discover that the PC is using 4-7GB of RAM, in this moment.

    For what? There's nothing that RAM hungry in task manager.

    I've attached screenshots.

    I've added another picture:enter image description here

    enter image description here enter image description here

    Here's the RamMap screenshot: enter image description here

  • Answers
  • David Schwartz

    When a system is not under memory pressure, there is no advantage to additional free memory. In fact, there are at least two significant disadvantages to having more free RAM. First, if RAM is free, it must be made unfree in order to use it, which is additional effort. Second, if RAM is free, then if the system needs the information it previously held, it must be recomputed or read from disk again. So free RAM is bad.

    If you're thinking, "I want my RAM to be free now so I can use it later", that's silly. The RAM can be used now and used later. Having RAM used now actually makes it easier to use it later, not harder.

    Most of your RAM contains file data and NTFS filesystem metadata (that's what "Metafile" means). This will make future file accesses faster. If needed for some other purpose, Windows will transition it directly to that other purpose without the wasteful extra steps of making RAM free just to later have to undo that effort and make it used again.

  • magicandre1981

    Based on the RAMMap screenshot I can see that the Metadata are extremely high. This is the file system cache. MS explained this here in a blog post.

    They provide a Service where you can limit the cache size dynamically. But the public service only works on Vista and Server 2008. The MS support has an updated version which works in Windows 7. Contact the support to get the fix.

    You can set a fixed limit with this tool:

    http://www.uwe-sieber.de/ntcacheset_e.html

    Also the paged and non paged pool is too high. I explained here how to track down which drivers use the memory.


  • Related Question

    64 bit - Why can't Windows 7 x64 use all installed memory?
  • Michael Haren

    I'm running Windows 7 x64 RTM on a Dell Latitude D520 w/ 4gb memory. The system control panel reports:

    System type: 64-bit Operating System
    Installed memory: 4.00 GB (3.24 usable)

    Why isn't all the memory usable? Since I'm running 64-bit, is this a dell limitation?


    Edit:

    It's given me more questions:

    1. If the system reports that I can use 3.24gb, does that mean that .76gb is being used by the video card? That seems like a lot, and the specs on this page state it will use up to 128mb)
    2. If .76gb isn't being used by video, is it being wasted?
    3. Does running 64-bit windows help me at all? If not, are there other advantages to 64-bit windows?

  • Related Answers
  • Waaahsabi

    Either you do what Post#1 suggests, or your motherboard simply doesn't support the memory address mapping, which means: No 4GB for you with this hardware.

  • John T

    There are 2 probable reasons for this.

    • You need to turn on Memory Remapping in your BIOS
    • Your video card may be sharing internal memory.

    It is usually the latter that is the case. This was one of the planned features of Windows 7, you can read up on it here.

  • wazoox

    It may be a windows limitation, too. However there aren't usually on pre-release version IIRC.

  • Jim Hunziker

    I have a D520, and I see about the same amount of loss. I'm running Linux with a kernel that has PAE enabled. I'd always assumed that the missing memory was being used for the onboard video chipset.

  • surfasb

    It's a limitation of your chipset/video card/device driver. Windows(or in some cases, BIOS) maps memory to the video card to use cause it doesn't have its own memory. Windows can't just use it whenever it wants cause, it would be a violation of sound principles. Microsoft had thought about mapping and remapping that memory above the 4GB line based on usage. The problem thought was this would cause HUGE instability on consumer systems. Notice that Windows Server does NOT suffer from the 4GB limit, even on x86 machines...

    http://msdn.microsoft.com/en-us/library/aa366778(v=vs.85).aspx#physical_memory_limits_windows_server_2003

    The reason was, again, device drivers. The server market tends to have a smaller market of device driver and DD developers, thus it was possible to test and support larger address spaces. On the consumer side, this is a nightmare. Technically, XP SP2 and above x86 OSes CAN use memory address over 4GB. Not all device drivers though supported that, since going over 4GB meant your pointers are longer. Thus DDs would often spit out an error and thus cause blue screen or not even boot.

    Another consequence of remapping the video memory is that the video card is latency sensitive. Remapping the memory back to the card involves the following:

    1. Moving whatever was there to the page file. . . (spin spin)
    2. Writing in the OS memory map database where you put the file
    3. If it needs contagious memory . . . repeat 1 and 2
    4. The video card then has to wait for the memory to be allocated. (twiddle thumbs)
    5. Loading up textures for the video card. (spin spin)
    6. Writing in the memory map database where you put the textures
    7. Then constantly poll the graphics card, "Are you done yet? Are you done yet?? Yeah! Yeah!? Cause Johnny boy in the taskbar REALLY REALLY needs to go BAD!!"
    8. The graphics card then decides, based on some algorithm, what it should and should not keep.
    9. Then tell the OS what part of the memory it is not using.
    10. All this in time to give you 60 frames a second (well not technically, but you see the point)

    This will also affect all the other drivers that the OS manages that are latency sensitive ie audio driver (skip skip) and network drivers (Hey, how did that guy teleport through the door!?)

    How can you solve this? By promoting a higher quality of device driver developers. They are HIGHLY underrated and unappreciated. Ideas include sending your local DD developers care packages, Lego Robotics kits, big monitors, and of course, women.