Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Windows memory paging

  1. Sep 28, 2009 #1
    I have wondered for quite a while why memory allocation and paging in Windows seems to be so weird and doesn't wanna use memory to the fullest.
    For example even when there is a lot of free physical memory, there are sections that are paged out.
    And then - physical memory never seems to fill up totally.

    I'd appreciate someone explaining the reasons behind this behavior.
  2. jcsd
  3. Sep 28, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper

    It's a complex subject -

    The main reason it uses swap/pagefile when there is free ram is that swapping out memory is cheap (in time) compared to getting it back, so when you have some memory that doesn't look like it's changing very often Windows (and most modern OSs) will swap it out when they aren't busy. If they then need some more memory for another task they can quickly delete the in-memory copy of the other data because they already have a swapped copy. Of course when the other process needs that memory it will have to be read back in - but thats a problem for the future.
  4. Sep 28, 2009 #3
    Let me see if I got this:
    Basically while windows is idle it uses the time to copy infrequently used data to HDD, so if the need arises for lots of memory, it can just delete the memory copy, without the effort of swapping it first.
    If this is right, then it does make a lot of sense and is actually a cool idea, provided the page replacement algorithm knows its job...

    Then there's the other extreme - why does it not use the entire physical memory space?
    For example I have 2048MB of memory and I have never seen it reach 2000MB physical usage(always ~19-- MB).
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook