Dismiss Notice

Welcome To CK5!

Registering is free and easy! Hope to see you on the forums soon.

Score a FREE t-shirt and membership sticker when you sign up for a Premium Membership and choose the recurring plan.

Question about swap file Windows XP

Discussion in 'The Lounge' started by 75-K5, Apr 26, 2005.

  1. 75-K5

    75-K5 3/4 ton status

    Joined:
    Apr 28, 2002
    Posts:
    5,353
    Likes Received:
    0
    Location:
    Anderson, Indiana
    OK I have my swap file disabled because I have 512MB of RAM and never use more than 250 at a time. I've looked through my entire hard drive and there is no pagefile.sys anywhere, yet when I run my diagnosis program it says I have 2GB of virtual memory. What and where is this VM it's talking about? Also in Windows Task Manager it shows how much of my pagefile is in use, but how can that be if I don't have a page file?
     
  2. sled_dog

    sled_dog 1 ton status

    Joined:
    Sep 3, 2002
    Posts:
    16,870
    Likes Received:
    0
    Location:
    Austin, TX
    right click on My Computer -> Advanced -> Performance -> Advanced -> Virtual Memory at the bottom

    Its hard drive space used for programs, used like memory. Too little and windows will not be happy. I have 1.5GBs allocated myself.
     
  3. TSGB

    TSGB 1 ton status

    Joined:
    Apr 22, 2002
    Posts:
    12,527
    Likes Received:
    0
    Location:
    Centralia, Washington
    I have Windows 2000 Pro, how do I change mine?

    Not to be pushy...
     
  4. 75-K5

    75-K5 3/4 ton status

    Joined:
    Apr 28, 2002
    Posts:
    5,353
    Likes Received:
    0
    Location:
    Anderson, Indiana
    Thanks, but I know what Virtual Memory is and I've already disabled my swapfile using that method. What I'm asking is why does it say that I have virtual memory when I've clearly disabled it?
     
  5. 75-K5

    75-K5 3/4 ton status

    Joined:
    Apr 28, 2002
    Posts:
    5,353
    Likes Received:
    0
    Location:
    Anderson, Indiana
    OK, after reading into stuff some more I've decided to set my swapfile at a minimum of 50 and a maximum of 256 MB. So far it's stayed at 50, meaning I don't really need the swap file. Still in my diagnostic program, it's reading as follows:

    Total Page File: 532 MB
    Available Page File: 337 MB

    Total Virtual Memory: 2 GB
    Available Virtual Memory: 1.96 GB

    Swap File Size: 195 MB
    Swap File Usage: 63%


    Where could these figures be coming from when I have my VM size set at 50 and I've checked the actual size of pagefile.sys and it's definitely 50MB? Where in the world does 2GB come from? Is my program (freshdiagnose) just screwed up and reporting the wrong information?
     
  6. newyorkin

    newyorkin 1 ton status

    Joined:
    May 8, 2001
    Posts:
    16,555
    Likes Received:
    157
    Location:
    Los Estados Unitos
    I'd suspect that.

    You can also get essentially the same info by going to the command prompt and typing "Systeminfo". Actually, I'm not sure if that's available in XP home and pro, or just pro.
     
  7. 75-K5

    75-K5 3/4 ton status

    Joined:
    Apr 28, 2002
    Posts:
    5,353
    Likes Received:
    0
    Location:
    Anderson, Indiana
    OK, systeminfo gave me a little bit different info, but tell me this. Why does task manager say my PF usage is 230MB when my pagefile.sys is only 50MB? Does it include all physical and virtual memory in that figure? Plus, I got a VM too low error (which I never got when I had no swap file at all) and it said Windows would increase the size of my swap file. I checked it again and it was still 50MB. What the heck is going on? Is there some hidden swap file that Windows is using instead of the real page file, or does it just not know what it's talking about?
     
  8. newyorkin

    newyorkin 1 ton status

    Joined:
    May 8, 2001
    Posts:
    16,555
    Likes Received:
    157
    Location:
    Los Estados Unitos
    How are you determining the 50mb usage? Are you looking at the actual pagefile.sys to see that? The actual size of that file isn't always accurately reported by the file system because it's a dynamic file that's often locked by the OS. What usage the OS reports (task manager) is more accurate because it actually accesses the VM/Pagefile.

    There's a registry hack you can add to force the system to wipe the pagefile at shutdown. This slows down shutdown, but it can help figure out the true usage if you restart, then check it immediately upon next login. Go to Start->Run->type "regedit" and hit enter.

    Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management", and double click "ClearPageFileAtShutdown". Click the "Decimal" button, then type "1" in the box, hit ok, close regedit, and reboot. Once it reboots, reboot again. On the next login after the second reboot, check your pagefile size and usage, and see if the numbers are different or closer.



    BTW, I have servers that run with 2gb ram, and I still use the swap file (it's a 3gb swap file :)). ere buying some new servers with 5gb ram, and I'm going to allocate 10gb for swap file...
    M$ doesn't recommend disabling it (I wouldn't either), too. It will perform faster if you move it to a different partition (you essentially need two pagefiles, 1 on the boot partition, one on a seperate partition).
     
  9. 75-K5

    75-K5 3/4 ton status

    Joined:
    Apr 28, 2002
    Posts:
    5,353
    Likes Received:
    0
    Location:
    Anderson, Indiana
    Thanks for the help, Ratch (and happy birthday). I happened across that registry hack a couple days ago and it's already in effect. I've seen conflicting theories about how you should manage virtual memory. Some say to make the max and min sizes the same so you won't get constant resizing, but others I've seen say to give it a small initial size so it won't be used if it's not needed. What settings would you recommend for 512MB of RAM. I don't usually use more than 250-300MB at a time and that's the extreme maximum. I don't play a lot of games or do pic or movie editing. I have it set right now at 50-256. I've noticed lately since I've re-enabled the swapfile that Firefox uses memory really strangely. With the browser window maximized it won't take long at all for it to reach 90MB memory usage, but when I minimize it, it goes all the way down to 860K. I guess I should just leave well-enough alone, but I can't figure out why the swapfile is needed if I rarely, if ever approach using my maximum amount of RAM.

    Also, I have a very small swapfile set on C: and my main one on drive Z: (which are both on the same physical drive), but I can't find a pagefile.sys on drive C: anywhere.
     
  10. newyorkin

    newyorkin 1 ton status

    Joined:
    May 8, 2001
    Posts:
    16,555
    Likes Received:
    157
    Location:
    Los Estados Unitos
    That's ok, that's exactly how they recommend setting it up. Windows figures out which drive to use for it on it's own, so it probably hasn't even allocated a file on C: for it.


    I've read that M$ recommends you size the pagefile min at 1.5 times the amount of ram present, so yours would be minimum 768, max ???. Everything I've ever read says they strongly recommend you don't disable it. I doubt it's really going to be a performance problem for you either way, but you will see some sluggishness if you start opening lots of programs (I occasionally have maybe 20 or so programs or windows open at once).

    A lot of M$ documentation says Windows won't use the swap file if it doesn't need it, but realistically, like you've seen, it does put some kind of footprint down even when it doesn't seem necessary...

    Personally, for servers I usually set the minimum to the amount of ram present, maximum to double the ram present, and set it on a separate "drive" (separate partition is fine). I seriously doubt it's necessary on plain old file servers like I run, but very memory intensive servers like sql or web servers, it would be beneficial.
    For workstations I set up (probably a couple dozen a year), I don't even touch it. On rare occasions, very memory-intensive users (photoshop, etc) report errors with VM size, but the OS auto-resize seems to fix it.
     

Share This Page