Virtual memory/ PageFile/ Swap Space -- what,s this all about?

Discussion in 'other software & services' started by aigle, Mar 11, 2007.

Thread Status:
Not open for further replies.
  1. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    Can anybody describe the simple diference between Page file, Virual memoy, Swap File, Swap Space etc.
    I am confused as it appears that different utilities are using the these terms loosely for different parameters.
    See my system snapshots of Everest, SysInfo, Windows Task Manager and Page File Monitor? It,s a bit confusing!!
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      156 KB
      Views:
      208
  2. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    Any ideas?

    Thanks
     
  3. WSFuser

    WSFuser Registered Member

    Joined:
    Oct 7, 2004
    Posts:
    10,639
    ignore the terminology and just know that you have 502/503 MB of physical memory and your page file is 753/754 MB.
     
  4. Niels

    Niels Registered Member

    Joined:
    Jul 29, 2005
    Posts:
    466
    Location:
    Belgium
    Virtual memory extends the amount of internal memory and uses some space on your hard disc that is called the page file (or swap file). The problem is when your computer accesss that it will slow down. See here for a description what a swap file is : http://www.computerhope.com/jargon/s/swapfile.htm
    Virtual memory: http://www.computerhope.com/jargon/v/virtmemo.htm
    Page file : http://www.theeldergeek.com/paging_file.htm (but that is the same as the swap file). You may multiply the amount of memory you have in your computer with 1,5. But don't forget that the amount you configure will be used.
     
  5. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    Page file and swap file is same, OK?
    My concept, page file plus physical memory= Virtual memory, Correct?

    But I can,t understand the Virtual Memory of 1728 MB shown by Everest ONLY.
     
  6. WSFuser

    WSFuser Registered Member

    Joined:
    Oct 7, 2004
    Posts:
    10,639
    that is correct
     
  7. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    So what about VM shown by Everest?
     
  8. WSFuser

    WSFuser Registered Member

    Joined:
    Oct 7, 2004
    Posts:
    10,639
    i think the virtual memory reported by Everest included your physical memory twice.
     
  9. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    I suspected so but question is that why they do so? Is it some specific measurement? I am not sure?
     
  10. Ice_Czar

    Ice_Czar Registered Member

    Joined:
    May 21, 2002
    Posts:
    696
    Location:
    Boulder Colorado
    swap space was what the pagefile was called back in Windows 3.0 up to Me
    in NT based systems NT\W2K\XP\ect its was always called the pagefile

    some applications employ their own "pagefile" photoshop comes immediately to mind and its called a scratch disk

    it might be useful to think of these terms from a slightly different perspective
    in a 32 bit system the OS kernel has a memory address space of 4GB
    that is split up in between both the Physical and Virtual memory, some of the address space is what is called user space, the rest is kernel space, obviously when the processor needs to access a bit of data its faster for it to be in caches (L1 or L2) slightly slower to be in physical memory (the RAM bank of the processor) and at least one order of magnitude slower to be on disk.

    When it doesnt find what its looking for in main memory (RAM) you get what is called a page hit, (it can be measured by an important performance monitor in NT\W2K\XP start > run > perfmon.msc > help)

    http://en.wikipedia.org/wiki/Page_table
    thrashing is the main thing you need to keep an eye out for
    and I consider putting a machine through a performance monitor period a critical step.

    in a 64 bit system the amount of address space is dramatically increased theoretically to 16 exabytes (16 Billion Gigabytes) but in reality 128GB in XP 64bit and 128 TB in OS X.

    getting back to kernel space vs user space, some applications (notable computer graphics) can far outstrip the memory needs of the kernel, when you start to have a really loaded mobo to address those memory needs (4GB) you'll likely see it split as 2GB kernel and 2GB user space, any given 32 bit application is limited to 2GB as a process, and the kernel typically doesnt need a full 2GB. So you can employ the /3GB switch to gain more memory for your applications, which means that one of them, say photoshop, can employ its full 2GB. 1GB for other user applications and the last GB for the kernel.

    In a 64bit system it gets more complicated, some aps are directly coded to take advantage of the larger memory available, few are coded to take advantage of the register extensions but even with a 32 bit ap running on a 64 bit platform, some additional tricks can be employed to get more memory, Photoshop CS has added more processes so it can exceed the 2GB limit

    a very useful article to understand some of the issues
    64-bit Computing In Real Life

    *W2K advanced server in fact (full support for the /3GB switch is lacking in the basic server)
     
    Last edited: Mar 18, 2007
  11. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    That seems a lot of info now, sure I need soem time to read it.

    Thanks
     
  12. Ice_Czar

    Ice_Czar Registered Member

    Joined:
    May 21, 2002
    Posts:
    696
    Location:
    Boulder Colorado
    tossed all that in to illustrate a few memory management concepts with real world examples, but from the perspective of an average user, its the ability to recognize thrashing when you see it that is important.

    you could be conducting your average low level multitasking on a day to day basis without ever experiencing thrashing, when one day you try to open a file that is just a wee bit too big (I have a 400MB .tiff photo from NASA) and suddenly your system appears to hang. Is it a hradware issue? a driver issue? or is it thrashing? ;)

    learning perfmon.msc (and by extension how to build real time desktop monitoring tools off those) can help you sort out lots of issues. Especially when working with older systems. ;)

    the other key concept is that of user space and kernel space
    "why would a puny 400MB file cause thrashing Ive got 2GB of physical memory?"
    because all your user space background processes + that file have eaten your total user space allocation
    the rest is reserved for the kernel, but thats not a self evident aspect to most folks
     
  13. osip

    osip Registered Member

    Joined:
    Oct 25, 2006
    Posts:
    610
    @Ice_Czar: Well,indeed comprehensive but useful info...You seem to be a giant in this field...What do you say about putting the pagefile on a ramdisk and leave the minimum 2MB on sysdrive?(provided you have enough RAM,of course...)
     
  14. Genady Prishnikov

    Genady Prishnikov Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    350
    I have 2GB of RAM and have done benchmarks using several tools running with page file OFF and page file ON. My system is much faster with the page file OFF. I've been doing it for three years on three different computers with as little as 1GB. I really didn't care what Microsoft said (they recommend against it), the performance tells the story.
     
  15. Ice_Czar

    Ice_Czar Registered Member

    Joined:
    May 21, 2002
    Posts:
    696
    Location:
    Boulder Colorado

    I wouldnt say that, just an Opteron workstation user.

    thats pretty much what Photoshop CS will do given enough RAM
    (toss its scratch disk on a RAM Drive)

    as always "it depends" :p

    with older computers, without a lot of extra RAM
    (here Im talking about 2GB or 1GB) I generally have plenty of HDDs and channels (2xIDE + SATA + PCI IDEx2) at that point employing multiple pagefiles\scratchdisks is a "free RAID0" but its really about the load your generating

    on the upper end past 4GB physical, there really arent any fully long coded (64bit mode) aps yet, and the few aps that are coded to employ greater than 2GB (Long Mode Compatibility Mode) are pretty sparse as well, so your board might as well being running a RAM drive if you can effectively employ it, but

    its sort of an oxymoron under 4GB w\a 32bit OS, your paging out of memory into memory,

    say you have 4GB physical and are using the /3GB switch, 1GB for the kernel
    2GB for a RAM drive that is loaded with say a video file your editing, where you dont need the full 2GB for the ap which is limited to 1GB
    that would be an an example of an exception, but most of the time your just robbing Peter to pay Paul, unless your employing it to "extend" an application like the CS example
     
  16. osip

    osip Registered Member

    Joined:
    Oct 25, 2006
    Posts:
    610
    Well,I´m not with that kind of RAM,what I meant was that if the page handling occurs digitally to/from a ramdrive instead of to/from the disk it should make a huge difference ...
    Upgraded recently to 896 MB sdram on an old PIII proc(1ghz)...Have seen various recommendations of the pagehandling options and decided to test Ramdisk Pro on my own...So,I left acc to MS recommendations a small PF on sysdrive (2 mb) and made the major PF on ramdisk for 250MB knowing that generally the PF should be 1-1,5xRAM...And,in spite of what others has said on other forums,I got a real boost...If this is generally recommendable or not,don´t know,but indeed had impact in my case...(additionally I also placed browser temp cache files on a small separate ramdisk and that gave even extra effect on internet page loading speed...)
     
  17. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    Ok, let me ak another Q, in XP Home I have chosen page file size to be adjusted by windows itself. Is it ok?
     
  18. osip

    osip Registered Member

    Joined:
    Oct 25, 2006
    Posts:
    610
    Not beeing an expert but have recently made some experiences on my own in this matter...The first you could try is to lock the page file size with min/max with the same value which acc to recommendation should be 1.5x your RAM Mb...If you have 512 MB it means min/max fixed size on 768Mb...

    If you have another physical drive it´s also not bad to move the page file to that one...Finally you can also try my above example and make the page file on a ramdisk...
     
  19. Ice_Czar

    Ice_Czar Registered Member

    Joined:
    May 21, 2002
    Posts:
    696
    Location:
    Boulder Colorado
    XP does a considerably better job at memory management than previous versions from what I gather, taking manual control of size and locations can be part of optimizing your system, but generally speaking it knows what its about.

    If you have multiple HDDs on multiple channels there can be advantages
    http://faq.storagereview.com/tiki-index.php?page=MultiplePagefiles

    otherwise I say let it be dynamic and self controlling
    the more RAM you have (and the less bloatware installed) the more likely your to see advantages from setting it up manually with a fixed size, (to limit how much gets paged out) but it really depends on your usage pattern
    http://support.microsoft.com/kb/889654
    http://www.microsoft.com/technet/pr...perfmon_to_monitor_the_file_system_cache.mspx
     
    Last edited: Mar 19, 2007
  20. NGRhodes

    NGRhodes Registered Member

    Joined:
    Jun 23, 2003
    Posts:
    2,381
    Location:
    West Yorkshire, UK
    If you put a pagefile on each physical drive, NT/2k/XP is smart enough to pick the least active drive for pagefile use.

    XP is fine at managing pagefile sizes itself generally.
     
  21. walking paradox

    walking paradox Registered Member

    Joined:
    Feb 9, 2007
    Posts:
    234
  22. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    Thanks. I will keep current settings then. I do have a single HD.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.