tweaks to page file for xp guest

Discussions about using Windows guests in VirtualBox.
Post Reply
TechMosaic
Posts: 2
Joined: 23. Feb 2010, 06:14
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xp

tweaks to page file for xp guest

Post by TechMosaic »

I am a newbie, and very confused.
I have read in various postings that....
- virtual memory on xp (paging file) should be completely disabled when running a VM (that was a VMWare suggestion, not a VirtualBox one).

- Another suggests that it should be fixed in size (beginning and end size set the same) so the page file size is 1.5 or 2 times the RAM, but never changes in size.

- A third says it needs to be very large, but on a separate disk.

- A fourth says leave it at the defaults, which would be a variable sized page file on the virtual c drive.[/list]

I cannot seem to find an "official" suggestions on what configuration to start with for my guestOS setups. My goal is just to have a few basic XP-Pro SP3 guests, probably only two running simultaneously at most. I am not gaming or anything, so my needs are simple, hence my thought that there would be a base configuration to start with that the VirtualBox developers think is optimal. My main goal is to have good performance even though my host machine has just 3GB or RAM.

Any thoughts?
Perhaps someone can just direct me to a good discussion on this...it seems that there should have been one..I just can't seem to find it anywhere.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: tweaks to page file for xp guest

Post by mpack »

All except the first are standard tips related to how to get the best possible performance out of your PC, but the tips are quite old (Win98 era) and I doubt they are of much value with XP and later.

In my opinion the only correct pagefile settings for a Windows host now are either: leave it on defaults, or disable it altogether (the latter only if your PC is way overspecced with RAM, e.g. my home PC is running XP Pro with 4GB RAM: with that amount of real RAM I'd say that virtual RAM is not necessary hence I've disabled the pagefile).

Returning to the first tip (the VMware one): I can't offhand think of any valid reason per se why a VM would not need a pagefile. On the contrary, the VM is likely to have limited real RAM and need a pagefile. I can see an argument for having a pagefile in a non-standard place, e.g. a volatile store so it gets discarded when the VM shuts down.
rjo98
Posts: 59
Joined: 6. Jul 2009, 17:32
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP, CentOS, Fedora

Re: tweaks to page file for xp guest

Post by rjo98 »

The first tip I'm not sure about, I could see where you wouldn't want a virtual machine using a page file on a host that's using a page file because if both host and guest(s) are using the page file (because you don't have enough ram in the host machine to begin with), that would be real performance heavy on your hard drive and slow everything down.

The page file is still a file mind you, so if its not set to a static size and is allowed to grow as needed, it will become fragmented. You'll notice on at least XP machines the "recommended" value it tells you is usually 1.5 times what you have, its been that way for a long time as a standard. you can increase it to a bigger multiple, but doesn't sound like you need or would want to based on what you're doing.

By default the page file is going to be "very large" so don't worry about that. and the idea behind having it on its own physical disk is to improve performance. all the paging can be separated out and done on the secondary drive, whereas your main drive will be for everything else. it does have its advantages when you're talking physical disks, but not sure with virtual disks since all your virtual disks are probably running off the same physical hard drive in your host machine anyway.

What I do is depending on how much available RAM i have on my host machine after its booted and all of its normal stuff is running, is to take that available amount of RAM (not total ram in the computer, but what's not in use) and divide that by the number of VMs i'm going to run at the same time. Then that gives you a rough idea of how much you can allot to each virtual machine. i usually make the number smaller than what that comes out to, so i don't totally use up all the RAM on my host machine. since my vm's dont have much ram associated to each and will eventually use the page file, i set the page file to a static amount, then download and run pagedefrag, just to eliminate any fragmentation in the vm's page file.

Seems to have worked out pretty well for me over the years, hope that helps you out.
Xenomorph
Posts: 7
Joined: 25. Oct 2008, 08:42

Re: tweaks to page file for xp guest

Post by Xenomorph »

mpack wrote:All except the first are standard tips related to how to get the best possible performance out of your PC, but the tips are quite old (Win98 era) and I doubt they are of much value with XP and later.

In my opinion the only correct pagefile settings for a Windows host now are either: leave it on defaults, or disable it altogether (the latter only if your PC is way overspecced with RAM, e.g. my home PC is running XP Pro with 4GB RAM: with that amount of real RAM I'd say that virtual RAM is not necessary hence I've disabled the pagefile).

Returning to the first tip (the VMware one): I can't offhand think of any valid reason per se why a VM would not need a pagefile. On the contrary, the VM is likely to have limited real RAM and need a pagefile. I can see an argument for having a pagefile in a non-standard place, e.g. a volatile store so it gets discarded when the VM shuts down.
I would say either leave the pagefile setting alone, OR set it to 1.5X (Microsoft recommended) or 2X the system RAM, min and max size the same to avoid fragmentation.

However, I would NEVER use your system with the pagefile disabled. It doesn't matter if you have 4 Gigs of RAM or 16 Gigs of RAM. The system uses the pagefile for various things that may not be immediately obvious, and it can still cause crashes to disable it, even if you have 4+ Gigs of RAM.

The Microsoft engineers and programmers are actually quite a smart bunch, and have setup Windows' memory usage and Pagefile settings a certain way because they know what they are doing. Thinking you should ignore their advice because you feel like you have plenty of RAM is NOT the best idea.

Many programs *expect* there to be virtual memory/pagefile available. My system has 8 Gigs RAM, and it still writes PLENTY to my pagefile.

Disabling the pagefile can actually reduce the amount of physical RAM available to some applications, hurt performance, and cause crashes. If there isn't a physical block to use, and no way to page unneeded data to swap, the program WILL crash.

Here is a blurb from another site:
"When an application starts up, it requests access to a certain addressable amount of RAM, which is often a lot higher than the actual RAM that it will use.

When you have a page file, as in a normal Windows XP installation, the system happily allocates only the amount of physical memory that the application actually uses. This leaves more memory free for other applications and for the system cache. This is done because the system knows that it can rely on a little more space in the page file should the application's memory requirements increase beyond the limits of the physical RAM used.

When you don't have a page file, the system has no choice but to reserve the entire amount the application requested of physical RAM, knowing that there is no longer a second chance. If the application doesn't use this memory then it results in wasted space - physical RAM reserved but not used.

Therefore, if you have a page file then the system will allocate the physical RAM much more efficiently and use less RAM per application. It will therefore run more stably, as it will reduce the likelihood that an application may request more addressable memory that is available."

In short: DO NOT DISABLE YOUR PAGEFILE.
rjo98
Posts: 59
Joined: 6. Jul 2009, 17:32
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP, CentOS, Fedora

Re: tweaks to page file for xp guest

Post by rjo98 »

good extra bit of info there xenomorph, I've read that before. My home system has 4GB and still uses the page file, so i can even personally vouch for that. and hopefully based on my previous post, the OP knows I also voted for not disabling the page file for his situation.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: tweaks to page file for xp guest

Post by mpack »

rjo98 wrote:good extra bit of info there xenomorph, I've read that before. My home system has 4GB and still uses the page file
I can vouch for the fact that it uses the pagefile too, even on a 4GB host. In fact it was the irritation of a constant clicking from the hard drive as XP accessed the pagefile that made me disable it (my home PC is quiet, but not as quiet as the room its in, and in fact the quietness of the PC made the clicking more noticeable). I reasoned that my last but one home PC ran XP in 512MB of RAM and a 1GB pagefile, so if my new total RAM is more than those combined, why do I need a pagefile?

And I've been running it that way for quite some time - no crashes, so my actual experience contradicts any stories that may be passed around.

But that is on my host PC with bags of RAM, I did not recommend disabling the pagefile in a typical VM running with (say) 512MB RAM.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: tweaks to page file for xp guest

Post by Perryg »

You don't always need a page file as stated from Microsoft support here

http://support.microsoft.com/kb/889654

Snip from the page:
When you set up a 32-bit version or a 64-bit version of Windows Server 2003 or Windows XP, a page file is created that is one and a half times the amount of RAM that is installed in the computer provided there is sufficient free space on the system hard disk. However, as more RAM is added to a computer, the need for a page file decreases. If you have enough RAM installed in your computer, you may not require a page file at all, unless one is required by a specific application.
The only need for the page file after you have reached a certain memory limit is due to specific program requirements and that is only if you install and/or use them. Does this effect performance any? Some I am sure but the individual user would need to monitor and see that it is and adjust accordingly. Servers and mission critical units should always have a page file but not always for the suggested intent. Dumps and the like require the page file or they will not happen.
gsearle
Posts: 36
Joined: 27. Oct 2009, 16:26
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: tweaks to page file for xp guest

Post by gsearle »

I'm running on a 32-bit Windows XP host with the maximum-addressable 3 GB physical RAM installed. The page file is off, and I typically see about 500MB remaining free memory headroom at the end of the day (with a VM and several applications running on the host). If I turn the page file on, the system slows down as it keeps sending memory blocks unnecessarily to disk.

The VM has a "Windows-determined" paging file set up on a separate, immutable virtual disk. Only if the VM requires more memory than allocated then a disposable virtual disk file is set up by VirtualBox to handle the overflow. This doesn't help with host fragmentation, but it does save host disk space.
rjo98
Posts: 59
Joined: 6. Jul 2009, 17:32
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP, CentOS, Fedora

Re: tweaks to page file for xp guest

Post by rjo98 »

Good points guys. It all comes down to everyone's individual setups, with how much RAM they have in their host machine, and what type of programs they run, there's no one size fits all answer. I mean if you have a machine with 4GB RAM and all you do is browse the web all day, you're never going to need a page file except for if you want system dumps. If you're running CAD or encoding video on that same computer, you'll want the page file for sure. Hopefully all this info we provided gives people the idea of how to handle their individual situations.
TechMosaic
Posts: 2
Joined: 23. Feb 2010, 06:14
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xp

Re: tweaks to page file for xp guest

Post by TechMosaic »

Wow! What a generous forum - I got a bunch of great info, which I greatly appreciate. Thanks to everyone for chiming in with such well thought out postings.

I am not quite sure exactly what I will do yet...I have a lot to think about and a few things to try and test out.

One followup question - What is a good tool for really knowing how the guest system is performing with respect to memory? I know there are some good tools, but I wonder if they are not accurate when run on a VM. Can I just use the Windows Task Manager in XP to look at pagefile and physical memory usage for my guest VMs and be ok, or are those readings somehow inaccurate because those tools are not designed to look at memory on a VM guest?
rjo98
Posts: 59
Joined: 6. Jul 2009, 17:32
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP, CentOS, Fedora

Re: tweaks to page file for xp guest

Post by rjo98 »

I always use Task Manager, since you're really just looking at another XP machine, just a virtual one this time. Or if there's other software you prefer that digs deeper or lets you get more detail than Task Manager, use that.

The overhead from the VM in regards to memory and stuff you would see in your monitoring of the host computer. Stating the obvious, but just being thorough.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: tweaks to page file for xp guest

Post by Perryg »

Task Manager works if you know how to read and use it. Very few really do. For more in depth information the Sysinternals Suite has all that you would need to properly monitor and adjust the system for optimal performance. http://technet.microsoft.com/en-us/sysi ... fault.aspx
rjo98
Posts: 59
Joined: 6. Jul 2009, 17:32
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP, CentOS, Fedora

Re: tweaks to page file for xp guest

Post by rjo98 »

I highly recommend the sysinternals tools if you want to get way in depth with more details like i was talking about in my previous post. If you're just looking for broad overview, Task Manager will do the trick. but if you're fine tuning for a production environment, get wild and crazy with the sysinternals tools.
Post Reply