[Solved] XP PageFile

Discussions related to using VirtualBox on Linux hosts.
Post Reply
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

[Solved] XP PageFile

Post by chameau »

I'm preparing an existing install of Windows XP sp3 (with other applications installed). Uninstall applications i wont use anymore, clean out log files etc.., clean with CCleaner, run defragmenter...
My question is: should I turn off 'Virtual memory' (Pagefile.sys)?
The host system is a Linux mint 17.3 (will upgrade to 19.0 before installing VirtualBox)
16GB Ram
HDD 1: 1TB used for Data Only, 3 partitions, 1 ext4, and 2 NTFS
HDD 2: 500GB used for Linux install (separate Root, Swap, and Home partitions)

I will be able to give XP VM 4GB of RAM, It will only be used for some apps I can't run in Linux like MYOB (accounting system), FoodWorks, and Chief Architect (architectural Cad) so I thought I don't need a PageFile? Not even sure if runing a PageFile within a VM is possible?
Last edited by chameau on 22. Aug 2019, 04:28, edited 1 time in total.
MontyMan
Posts: 29
Joined: 30. Jan 2019, 22:08
Primary OS: Linux other
VBox Version: OSE Debian
Guest OSses: Windows 10, Windows XP SP3, Haiku
Location: Houston, Texas USA

Re: XP PageFile

Post by MontyMan »

Dear Chameau,

If Microsoft designed the swap-in and swap-out memory scheme perfectly, then you should not have to include a swap file. But that's a pretty big "if." Also, if you're using a dynamic disk IMG, it may not even increase the size of the IMG file except in the unlikely event it has to be used. If I remember correctly from my own XP computer, if a program needs memory beyond the point XP thinks it needs to swap something out, and an adequate swap file isn't available, the program will fail. In my opinion it's a good insurance policy to keep the swap exactly as it is on the legacy system. You are using a CAD program, to add a little risk that swapping might be needed, and even more risk that Microsoft's built-in bloatware will think it's needed.

HTH
.Monty.
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: XP PageFile

Post by chameau »

Thanks MontyMan,
I have no experience with VirtualBox, so I just thought that a Virtual Memory inside a file that holds a Virtual OS on an Actual OS may create some problems. And I also thought that VirtualBox (the application) would have a setting to create a Virtual Memory for the Guest OSs to use as needed. Looks like it's not a problem at all. I have plenty spare HDD space, so no problem creating/having a 'Swap File'
Just one more clarification - As i'm copying an existing install of Windows XP (and converting it to DVI) would it be better to turn Virtual Memory to OFF before copying the install and then creating a Virtual Memory file in Windows XP once installed in VirtualBox? Or just leave it as is - copy the install with the Pagefile and install it into VirtualBox? Thanks
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: XP PageFile

Post by socratis »

chameau wrote:My question is: should I turn off 'Virtual memory' (Pagefile.sys)?
No.
chameau wrote:would it be better to turn Virtual Memory to OFF before copying the install and then creating a Virtual Memory file in Windows XP once installed in VirtualBox?
No again.

Don't mess with the guest OS, it doesn't have the slightest idea that it's not running in real hardware. If you start removing vital pieces, it's going to be messed up, for sure. Do not mess with things like that until you have a better understanding of what a VirtualMachine is or isn't...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: XP PageFile

Post by mpack »

Contrary to the previous answer, I would turn off the pagefile if you're going to give XP multiple GB of RAM. With that much RAM it should never need to page. I used an XP host well into the Win10 era, and always had the page file turned off (the noise of hdd accesses on my PC drove me nuts, so I did everything I could to minimize them), and it never created any problems. I wouldn't expect any, unless you deliberately stress it with some monster RAM hungry app.

Also, if you have multiple GB RAM then it creates a problem for the hard disk, because the swap file is conventionally some multiple (e.g. x3) of the RAM size. That's a significant chunk of space in a VM disk.

XP was designed for an era where a typical PC had 64MB RAM. A pagefile was a necessity. It isn't a necessity when the PC has 4096MB RAM.

So yes, turn it off.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: XP PageFile

Post by socratis »

Interesting mpack... I thought that the pagefile (and the swap in Linux, 'vm' in OSX) were a requirement for the OS. I know that chances are that if you never cross around 70% of the RAM you won't activate/need it, but not that you could get away with a non-existent one.

If that's the case, you wouldn't need it in real life too, no? Is this an option in real life? Filling the system with lots of RAM and no swap/pagefile? Note that I don't care about the hard disk aspects of the whole exercise, just the theory behind it; can you survive without one.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: XP PageFile

Post by mpack »

No, a swapfile is not a necessity, it's just additional very slow RAM.
socratis wrote: If that's the case, you wouldn't need it in real life too, no?
I already said so in my last post, i.e. I ran XP as my for years with no swapfile, including using that host to run VirtualBox. Nothing terrible happens when you run out of RAM, just the obvious - the app you're using gives an error message or crashes. But I was almost never anywhere near that happening (in fact never on XP, it happened a couple of times on Win98 with much lower RAM totals involved).

A typically scenario in 2002 was an XP machine with 128MB RAM and a 384MB swapfile. Horrible performance. It ran very sweetly when I upgraded it to 256MB with a 768MB swapfile. That's 1GB RAM in total (physical + swap). XP would crash (or not) in exactly the same way if it had 1GB physical RAM and no swap file. 4GB RAM total was unobtainable to the likes of me in 2002. With that much RAM there's absolutely no reason to extend RAM with a swapfile.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: XP PageFile

Post by fth0 »

mpack wrote:Contrary to the previous answer, I would turn off the pagefile if you're going to give XP multiple GB of RAM. With that much RAM it should never need to page.
While it's true that any OS (incl. Windows XP) with enough RAM can work without a swap space (Windows: pagefile), there can be negative performance impacts. Consider the following (simplified) real-world example:

A software developer is running two applications simultaneously: An IDE (Integrated Development Environment) and a web browser. In the web browser, multiple web pages are displayed for occasional reading. After some minutes, parts of the web browser's dynamically allocated memory are automatically moved by the OS from the RAM to the swap space, if available (this can amount to several 100 MB per web page in modern web browsers). In the IDE, a large software project is maintained, and the OS uses all free RAM as a file cache. When building the software project (or searching in the source files), the performance can greatly vary depending on the size of the file cache. Of course you could argue that the software developer has not enough RAM. ;)

This has only been a simplified example. The inner workings of memory paging inside an OS are much more complicated, and it has not become easier since the Windows XP times. I therefore would not recommend to work without a pagefile (unless you really know what you are doing ;)).
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: XP PageFile

Post by mpack »

I'm not sure what your point was there. I don't subscribe to "ooh that's voodoo, don't touch that" (wave hands for best effect). I've implemented paged RAM myself in the past for embedded devices, there's nothing magical about it, it's just a way of making it seem (to the foreground app) like more RAM is available than there actually is. It is NOT a necessity - and it's always better if you don't have to pretend.

The only thing that happens if you turn off pagefile swapping is that virtual RAM (not talking about VMs here), now equals physical RAM, which means you won't ever get page faults or the overhead (and disk noises) of servicing them. Yes, you can now run out of RAM earlier - but that's why you bought more RAM to cancel out that downside.

And if you have 4GB physical RAM, I'm not even certain that it's possible to run out of RAM on a 32bit Windows OS. I admit I've done no research on this, but I'd be surprised if the virtual RAM range in XP can be bigger than 32bits can address, which means that you can't address more than the 4GB physically available anyway.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: XP PageFile

Post by fth0 »

mpack wrote:I'm not sure what your point was there.
My point was to enrich the discussion between socratis and you (for the benefit of the OP), by showing a typical case in which the usefulness of a pagefile is often not understood, and thereby advocating the use of a pagefile.

Your advice to turn off the pagefile is based on your own, well established experience, and I agree with many (but not all) of your statements regarding this. And since you countered my statement 'The inner workings of memory paging inside an OS are much more complicated.' with 'voodoo' and 'nothing magical', I'll accept the challenge and comment some of your statements below. ;)

But first I'd like you to take a look at the following blog post, which IMHO is a good summary of some of the 'more complicated' concepts involved (e.g. committed memory, mapped memory, (non)pageable virtual memory), and which gives an answer to the question why you still (could) need a pagefile: The Out-of-Memory Syndrome, or: Why Do I Still Need a Pagefile?.
mpack wrote:And if you have 4GB physical RAM, I'm not even certain that it's possible to run out of RAM on a 32bit Windows OS. I admit I've done no research on this, but I'd be surprised if the virtual RAM range in XP can be bigger than 32bits can address, which means that you can't address more than the 4GB physically available anyway.
Each 32-bit process (running application) in a 32-bit Windows OS has its own virtual address space of 4 GB (at the same virtual addresses), consisting of 2 GB user space (0x00000000 - 0x7fffffff) and 2 GB kernel space (0x80000000 - 0xffffffff) (ignoring the /3GB and PAE options here for simplicity). And one of the key concepts of virtual memory is that the processes can have contiguous virtual memory ranges, while the 4k pages are scattered over the physical memory (or the pagefile). Now imagine what happens if you have 3 processes that ask the OS for 1,5 GB each ...

BTW, while a single pagefile is limited to 4095 MB (on a 32-bit Windows OS), you can have multiple of them (one per drive and folder).
mpack wrote:give XP multiple GB of RAM. With that much RAM it should never need to page.
Reminds me of the alleged statement of Bill Gates "640K ought to be enough for anybody." :)
I've personally seen thrashing on a 32-bit Windows 7 OS, where 4 GB RAM are more common.
chameau
Posts: 30
Joined: 11. Aug 2019, 18:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Windows 7 pro

Re: XP PageFile

Post by chameau »

Looks like I open a can of worms!! sorry that was never my intention. I read all the excellent replies (and the links) and are now better informed about pagefiles that I expected to be - Thank you.
As I said in my initial post, the system has 16GB of physical RAM and I intend on giving 4GB of RAM to Windows XP in VirtualBox. I could give even more RAM, but as far as I know Win XP 32bits can not use more than 4GB of physical RAM! (If this is incorrect please let me know).
Hard drive space was never an issue, I was just wondering if a 'Pagefile' was still needed (and safe to use) within a VM.
The current C drive partition is 230GB but only 26GB used, so I could reduce it to 50 or 70GB and set the pagefile to 6GB (i.5 x physical RAM).
One small point remains unanswered: is it better to convert the physical install with the 'Pagefile' to VDI? or is it better to remove the 'Pagefile' before converting to VDI and turn back on 'Pagefile' after XP is installed in VirtualBox?

So in conclusion, while I don't think I will need a Pagefile and as Hard Disk space in no issue, I will use one just to be safe. :)
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: XP PageFile

Post by socratis »

As I originally said and is my current belief, I wouldn't mess with the minute details of the memory handling of the OS, not too much to gain.

I would convert the whole thing as is. If the conversion or the VM turns out to have an issue (or more), at least I'll know that the pagefile isn't one of them. That's my 2 cents...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: XP PageFile

Post by mpack »

chameau wrote: So in conclusion, while I don't think I will need a Pagefile and as Hard Disk space in no issue, I will use one just to be safe. :)
And there's the Voodoo attitude for you. :)
MontyMan
Posts: 29
Joined: 30. Jan 2019, 22:08
Primary OS: Linux other
VBox Version: OSE Debian
Guest OSses: Windows 10, Windows XP SP3, Haiku
Location: Houston, Texas USA

Re: XP PageFile

Post by MontyMan »

Dear Chameau,

+1 what Mpack said. You may want to leave everything as-is, just to make the conversion, test your application, get everything working (network, pointing device, speakers, whatever your application needs to do its job) then make a backup, and try changing one thing at a time like eliminating or reducing page file, and maybe improve performance. But at each step make sure your program still works. You are on your way! HTH... Monty.
Post Reply