The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Virtual Memory Optimization

    Discussion in 'Windows OS and Software' started by vaio2k7, Oct 7, 2007.

  1. vaio2k7

    vaio2k7 Notebook Evangelist

    Reputations:
    91
    Messages:
    549
    Likes Received:
    0
    Trophy Points:
    30
    I dont know if there is a particular amount to allocate as virtual memory but in reading this pdf guide called TweakGuides Tweaking Companion for Windows Vista, it suggests that for those with 2GB RAM, allocate essentially 1GB for your pagefile.

    The guide suggests that for those with 1GB RAM, set virtual memory to 2GB...for those with 2GB RAM, set it to 1GB, and for those with 3GB-4GB RAM, set it to 512 MB.

    I thought most people set it at 1.5x-2x their physical RAM, and I see that the default for me is 3055MB.

    I think its just a little unusual to set the virtual memory value to be less than your actual physical RAM.

    Maybe someone could elaborate on importance and optimization of virtual memory, for different amounts of RAM (512 MB/1GB/2GB)?
     
  2. comper

    comper Notebook Consultant

    Reputations:
    15
    Messages:
    207
    Likes Received:
    0
    Trophy Points:
    30
    I wouldn't recommend setting it to anything less than the amount of physical RAM yo have. I do recommend to set both values to an equal amount so it doesn't have to expand itself. Setting the pagefile "too high" will not result in any loss in performance.
     
  3. Lawrence

    Lawrence Notebook Evangelist

    Reputations:
    255
    Messages:
    492
    Likes Received:
    0
    Trophy Points:
    30
    Windows sets the initial minimum size of the paging file at the amount of random access memory (RAM) plus 300 megabytes (MB) and the maximum size at 3xRAM installed on your computer. If you see warnings at these recommended levels, then increase the minimum and maximum sizes.
     
  4. John Ratsey

    John Ratsey Moderately inquisitive Super Moderator

    Reputations:
    7,197
    Messages:
    28,841
    Likes Received:
    2,165
    Trophy Points:
    581
    The total memory requirement (physical + virtual RAM) should be the same for a particular operating condition so the Tweak Guides makes sense to me. I also believe in a fixed size swap file to avoid it getting fragmented.

    Some programs (photo editing & GIS come to mind) can use large amounts of RAM so the best way to estimate your virtual RAM requirements is to open up all the applications which you might have open at any one time, then open up lots of files within those applications and look in Task Manager to see how much memory you are using.

    Unless you are desperate for HDD space, there's no disadvantage to being generous with virtual memory. The operating system will only use the space it needs. At the moment I'm on 3GB physical + 3GB virtual and don't expect to ever get an "out of memory" message.

    John
     
  5. vaio2k7

    vaio2k7 Notebook Evangelist

    Reputations:
    91
    Messages:
    549
    Likes Received:
    0
    Trophy Points:
    30
    I have never received a message saying I am "out of memory" but I just wanted some insight on what happens if you set virtual memory too high (like maybe 4+ GB)

    Right now I have not changed it from the default of 3055MB.
     
  6. kanehi

    kanehi Notebook Deity

    Reputations:
    146
    Messages:
    1,943
    Likes Received:
    0
    Trophy Points:
    55
    Once I used a video editing program and it told me I was low on memory even though I had 4gb on a Vista Ultimate system. I raised the paging file permanently to 5gb (had enough space to do so) and never saw that warning again.
     
  7. neopran

    neopran Notebook Enthusiast

    Reputations:
    0
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    15
    Usually having lots of RAM means that the OS needs to swap less. If you have more then 2GB of RAM, it's sort of a waste of disk space to create a huge swap file. I stopped using swap on XP since getting 1GB of RAM, now I have 2GB. Not using swap forces the OS to run totally from RAM. Never had any oom's errors. And yes I did see improvements in the speed of my system. I'm not sure I would totally get rid of the swap file in Vista though. Depending on what you do, I think it's safe to follow that guide and have it at 1GB which is half your RAM. Haven't used Vista a lot thought so you're gonna have to experiment for yourself. I find XP to be faster and more stable for now. Hopefully SP1 for Vista will change this.
     
  8. orev

    orev Notebook Virtuoso

    Reputations:
    809
    Messages:
    2,829
    Likes Received:
    1
    Trophy Points:
    56
    Don't mess with the settings. Most tweak guides are crap. Just leave it set to automatic and leave things alone unless you are seeing a specific problem.
     
  9. theZoid

    theZoid Notebook Savant

    Reputations:
    1,338
    Messages:
    5,202
    Likes Received:
    22
    Trophy Points:
    206
    Nowadays just let Vista manage it. Vista seems to run better when you let it do it's own thing :)
     
  10. FooTBall100

    FooTBall100 Notebook Geek

    Reputations:
    3
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    15
    Has anybody tried using a separate partition for their swap file as suggested by this tip swapfilepartition The idea is that it should help to minimize the fragmentation on your main C: partition by relocating the swap file. Would fixing the default and maximum size of virtual memory achieve the same result ie 1 big file could be allocated and it wouldn't change size thus in theory it shouldn't become fragmentated?

    I'm getting a new Vista notebook for Christmas so I'm trying to decide if a partition just for virtual memory is a good idea. I will have 2GB RAM so according to that tip I should set the partition size to 5.5GB with virtual memory set to 5GB - you need the extra 0.5GB to prevent low memory warnings. My disk is 250GB but that still seems a big chunk of it if it doesn't get used!
     
  11. orev

    orev Notebook Virtuoso

    Reputations:
    809
    Messages:
    2,829
    Likes Received:
    1
    Trophy Points:
    56
    The nice thing about the Internet is that it's easy to find a lot of information. The bad thing about the Internet is that it's easy to find a lot of wrong information.

    From the article:
    No, actually you won't notice the difference. Any potential difference would be in nanoseconds, and those would be offset by the fact that the hard disk needs to seek to a totally separate part of the disk each time it needs the pagefile. Doing this could actually slow down your system.

    OK, enough of the rant... Often the idea of a separate swap partition comes from a misunderstanding of the fact that if you put it on a separate physical disk drive, you will see some slight performance improvement because if that's all the disk is doing, it isn't competing with everything else you are doing. Some people then extrapolate and say that, "well, I only have 1 hard drive, so another partition is almost like that same thing!". That's not true, because the performance only comes from it being a separate disk. Then that guy writes a guide like this, and after realizing his folly, has to come up with some other way to justify the silly advice he's been giving out.

    As for fragmentation... The performance impact of disk fragmentation is WAY overblown. If you have a movie that you downloaded from p2p with 10,000 fragments, then yes, you will see problems when playing back that file, but in general all of your programs and data are small enough that fragmentation doesn't cause much more of a problem because the disk has to seek to find the whole file anyway. Rarely are 2 whole files right next to each other on the disk.

    Now you want some recommendations. Keep in mind that most "guides" are merely regurgitations of the "common wisdom" that people have heard over and over, and most of the guide writers don't actually understand what they are saying, or they do but not on a deep enough level.

    Finally, the answer you are looking for, which you will not find in any "tweak" guide: Leave the swap settings alone. Don't change them, don't touch them, don't worry about them. Just leave it alone and let Windows handle it.

    PS. Also ignore all the "tweak" guides. They are almost all garbage and tell you to do things to your system without explaining or even knowing the implications. If there are some things that are bothering you, just change those, but otherwise leave everything else alone.
     
  12. Jalf

    Jalf Comrade Santa

    Reputations:
    2,883
    Messages:
    3,468
    Likes Received:
    0
    Trophy Points:
    105
    Most people don't know what they're doing. ;)

    The myth that you should set it to 1.5x-2x your RAM is just that, a myth. It makes absolutely no sense.
    The entire point in a pagefile is that it should cover for you when you run out of RAM. In other words, the more you run out of RAM, the bigger your pagefile should be. Which means that the less RAM you have, the bigger your pagefile should be.
    I think the guide you've found makes good sense.
    Having 4GB combined RAM + pagefile is generally optimal.

    No harm in that. The pagefile only holds data that "spills" out of RAM. Since a 32-bit OS operates with a 4GB virtual memory space, it can never keep track of more than 4GB of data. If you have 3GB of RAM, then you'll never have more than 1GB of data spilling out, so you'll never need more than 1GB pagefile.

    The pagefile doesn't have to be bigger than your RAM, because data in RAM isn't mirrored in the pagefile.

    Hope that helps. :)

    When all that is said, I agree with orev's post above. Generally, you might as well just leave pagefile settings alone to be managed by Windows.
     
  13. FooTBall100

    FooTBall100 Notebook Geek

    Reputations:
    3
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    15
    Cheers Orev, thanks for your comments, I think I'll put this supposed tip down as a waste of time and effort.

    Apologies for deviating from the main theme here but one tip I am keen on however, and maybe you or someone else has an opinion to offer, is that of creating a data partition, the main plus points I can see are that this would (a) Make it easier to do a clean re-install of Vista if required, and (b) Makes it easy to do a backup of all your user data - obviously users (myself mainly!) would have to make sure they used this data partition to make this possible rather than folders on the C: partition. I plan to use the MKLINK command to create a 'C:\Users' junction point that hardlinks to 'D:\Users' (ie my data partition) so that all the 'Documents', 'Contacts' etc folders under 'Users' and 'Public' are automatically located on the data partition but I'm not sure how these are processed by Vista and if it could impact performance.

    Thanks
     
  14. orev

    orev Notebook Virtuoso

    Reputations:
    809
    Messages:
    2,829
    Likes Received:
    1
    Trophy Points:
    56
    AFAIK, you cannot make hard links to another disk/partition. You can relocate where Windows looks for your home directory, which is how you should go about doing it.

    As for the separate partition itself, my preference is not to use them. It's just as easy to remember to keep your data in your home directory as it is to keep it on a separate partition. Having a separate partition invariably leads to the problem where you put too much disk space in one partition, and now you need it on the other. Using 1 partition gets rid of this problem.

    If you are clean installing that often, then you should have an external disk for backup anyway. Even if you're not, you should still have one. Even if you have a separate data partition, do you trust the install process enough not to mess with it?
     
  15. FooTBall100

    FooTBall100 Notebook Geek

    Reputations:
    3
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    15
    Thanks again Orev for your comments, I can undertsnad your points although it's still something I'd like to try out - this link indicates that you can achieve this by using MKLINK to another partition, think I'll give it a go when I first set up my notebook.
     
  16. theZoid

    theZoid Notebook Savant

    Reputations:
    1,338
    Messages:
    5,202
    Likes Received:
    22
    Trophy Points:
    206
    Yep, I let Vista manage it. The static page file formula thing is an ancient carryover from the early Windows where it probably did have a performance impact.
     
  17. kanehi

    kanehi Notebook Deity

    Reputations:
    146
    Messages:
    1,943
    Likes Received:
    0
    Trophy Points:
    55
    Just let Windows decide. I had a pagefile set at 6gb and had memory dumps problems. After I re-setted to Windows' defaults, no more dumps.
     
  18. Jalf

    Jalf Comrade Santa

    Reputations:
    2,883
    Messages:
    3,468
    Likes Received:
    0
    Trophy Points:
    105
    Sure you can. (Or in this case it'd be junction points, but anyway)
    I do exactly that, and it works great.

    What I do is this:
    My Windows partition (D :) contains:
    - The Windows folder
    - A junction point named "Program Files", pointing to "F:\Win32\Program Files"
    - A junction point named "Documents and Settings" pointing to "F:\Win32\Documents and Settings"
    (And a similar junction point for my games folder)

    This means that I can format D: at a moment's notice, without losing *any* data.
    It also means that I can install software to the default location (Program Files), and it'll get redirected automatically to my data partition.

    There are two disadvantages though:
    1: Installers can't usually keep track of junction points. So when I install software, it checks for free disk space on D:, where it's F:'s space that actually matters. To work around this, I've had to make D: so big that there are always ~10GB free. (I think it's currently 25GB)
    2: It's a bit awkward to set up. Obviously, Windows doesn't like it if you delete Docs & Settings or Program Files. With a bit of creativity you can work around that, though. (I have two Windows installations, so I simply booted into my secondary Windows install, moved the folders from within that, and created the necessary junction points, and then booted back into the main Windows)

    You can probably get around it with safe mode as well, if you're careful and shut down a lot of processes, or you can boot from a liveCD such as BartPE.
    Use your imagination. :D

    This is on XP though. I know Vista by default uses junction points for its system folders (Users and what they other ones are called), so it'll probably be easier to set up there. In which case you can disregard disadvantage #2. :)
     
  19. orev

    orev Notebook Virtuoso

    Reputations:
    809
    Messages:
    2,829
    Likes Received:
    1
    Trophy Points:
    56
    Sounds like a pretty interesting setup. I think it makes my point about unnecessary added complexity though ;)
     
  20. ScuderiaConchiglia

    ScuderiaConchiglia NBR Vaio Team Curmudgeon

    Reputations:
    2,674
    Messages:
    6,039
    Likes Received:
    0
    Trophy Points:
    205
    One man's "unnecessary added complexity" is another man's "need to have this". ;)

    Gary
     
  21. Jalf

    Jalf Comrade Santa

    Reputations:
    2,883
    Messages:
    3,468
    Likes Received:
    0
    Trophy Points:
    105
    Exactly.

    I'm not saying everyone should do this, but it works great for me, and the complexity is only when you set it up initially (and as I said, that part should be easier under Vista)
    And it has saved me a lot of trouble, and even preserved my data in face of a harddisk crash. (Windows disk died, and if I hadn't made this setup, a ton of my data would have been on the Windows partition)

    So yeah, I'm happy with this setup, but I agree it's not worth it for everyone.
     
  22. ScuderiaConchiglia

    ScuderiaConchiglia NBR Vaio Team Curmudgeon

    Reputations:
    2,674
    Messages:
    6,039
    Likes Received:
    0
    Trophy Points:
    205
    I'm with on this 100%. I have always used multiple partitions with my MyDocuments folder, my Outlook.PST file and Favorites folder moved to a D: drive. That way I can ghost image my C: drive and restore it at anytime that I might need to. But that is not NEARLY as extensive as your solution. My way still leaves a few things behind in the "Documents and Settings" folder, but those (at least for me) are only minor annoyances if I did restore my C: partition. I really like your solution a LOT!!!! I am going to have to set aside some time to do this. But I assume I will have to undo my repositioning of my folders before I start. I need to think that through first.

    I have never bothered with moving the Program Files directory though. I felt that it was always so inexorably tied to the registry that, again at least for me, it seemed that if I was going to have to restore the C: partition my Program files directory would be out of sync with my registry and I would have to reinstall some application anyway.

    Gary