XP Pagefile on a RAM disk?


Recommended Posts

Pretty sure you shouldn't use RAM for the page file. Have a look at this thread.

If a ramdisk takes away from your available memory, I would agree that it makes no sense to put your swap file in memory.

But that doesn't have to be the case if you have more than 3.5GB of memory on 32-bit Windows. In that case, having a pagefile on a ramdisk is the closest you can get to actually making use of all your memory. Otherwise all memory above 3.5GB is lost.

~ TDW

Link to comment
Share on other sites

Hey folks!

I'd like to add a little fire to this discussion! ;)

We all know and love the limitation of 32bit Windows to only use 4GB of memory minus the combined memory of all gfx cards and then some. In my desktop system, for example, I have 4GB of memory and two 512MB GeForce cards. Windows reports 2.75GB of available RAM. My laptop has 4GB and a single 512MB gfx card and reports 3.25GB.

There's been quite a bit of discussion about possibly breaking this limit using PAE or whatever and most "experts" agree that it's not possible.

Now: I have been able to make this work using the Gavotte RamDisk! The "new" version (v1.0.4096.5) of this ramdisk has a switch to use PAE to place the disk at the end of the physical memory, i.e. into the part that is hidden by the gfx memory.

WinXP Pro SP3 on my desktop is currently telling me that I have 2GB of my 2.75GB physical memory available. IN ADDITION I have a 1.25GB RamDisk "exposing" the RAM that is hidden by the gfx memory. I just ordered myself another 4GB and am hoping to have a 5.25GB Ramdisk on Tuesday (go Newegg!) in addition to my usual 2.75GB RAM. If anyone cares, I can report success or failure.

Apart from the fact that using this ramdisk to hold a disk-image for VirtualBox means pure pleasure when using the guest OS, I would love to move my page file onto this ramdisk to effectively INCREASE the amount of available ram (rather than trading real ram for paged ram). Also, this will allow me to free up a couple extra gigs on my tiny (due to cost) SSD harddisk.

I've tried simply telling windows to put the page file onto only the ramdisk, but when I reboot I find that Windows decides to place another 2.75GB page file on one of my other drives without telling me or even fessing up to it in the Advanced Performance Options. The ramdisk is empty, even though Windows claims to have a 256MB pagefile on it.

According to the ramdisk's docs it should be possible to make this work. At least I think that's what it says. It's pretty horrible English. But I haven't been able to do so and I'm sure some of you would love to help me out playing with this to see if you can get it done.

The Gavotte Ramdisk is (supposedly) based on the M$ Ramdisk.sys sample driver available here:

FILE: Ramdisk.sys sample driver for Windows 2000

It turned out to be EXTREMELY difficult to actually find the Gavotte version. I finally dug it out of a Japanese hosting page (Thank you, Google Translate!) that you can find here:

Gavotte_RAMDisk_1.0.4096.5_200811130.7z

To download it, you need to "solve" the captcha in the top right corner of the page and click the long button right below the text field. You will then be directed to a page with an ad and a big button in the bottom middle that counts down 40 seconds or so. After, the button turns blue and you can click it to download the file.

I am currently running this version of the ramdisk on my system and have had no problems with it. Avast! does not seem to object to it either, BUT: I DO NOT KNOW WHO WROTE THIS DRIVER AND WHETHER IT IS MALICIOUS OR NOT! SO, USE IT AT YOUR OWN RISK!!!!

Setup could not be easier (other than the page file business). This page describes how:

Gavotte Ramdisk - Free virtual harddisk

Now, "facepalm" me if I'm crazy ;) , but I think for this scenario, putting the swap file onto a ramdisk makes perfect sense. Especially as it increases security since you don't have a leftover pagefile.sys on your platter after shutdown that contains evidence of things you did during your session.

BTW: My ultimate wet-dream regarding this is to get Windows to load an image onto the 5GB ramdisk and then use it as the C: drive to boot from. Supposedly with the XPe (embedded) or 2K3 Server NTLDR file this is possible (at least when loading the image from a "LiveCD"), but I haven't tried it yet. Would be nice to have a "freshly installed" (from image) copy of Windows running off a ramdisk every time you turn on the PC. No more worrying about speed, viruses, ...

Cheers,

TDW

DO NOT do this. The API being used to map into the otherwise unaddressable memory was not meant to be used this way. It happens to work sometimes, but the kernel makes no guarantees that the memory layout is the way that this hack assumes it will be. You're just asking for trouble.

If you have more than 3GB of RAM, use a 64-bit OS.

Link to comment
Share on other sites

DO NOT do this. The API being used to map into the otherwise unaddressable memory was not meant to be used this way. It happens to work sometimes, but the kernel makes no guarantees that the memory layout is the way that this hack assumes it will be. You're just asking for trouble.

If you have more than 3GB of RAM, use a 64-bit OS.

Thanks for your reply!

I don't know how the driver works internally, but it probably uses this API:

MSDN Library - Address Windowing Extensions

The article mentions a few restrictions on how the mapped memory can be used. Do you know which one of them makes this API unreliable to use for ramdisks? At first glance, it's not immediately clear to me why one of them should be fatal. All that the driver needs to be able to do is reliably read from or write to a "sector" (512Byte block) in the memory to service the disk requests. That seems like a fairly basic requirement for the API in general. But maybe I'm missing something. I guess I would like to know if you could be more specific about "to be used THIS way".

In general, I would agree with you about using a 64-bit OS, but unfortunately there are two things holding me back:

a) a couple hardware drivers (e.g. some HP Laserjets) are not available in 64bit yet.

b) I'd rather not pay for another copy of Windows.

But that aside: Do you know how one would go about placing the page-file on the ramdisk? (Independent of whether that is a good idea or not... :))

Thanks,

TDW

PS: I really liked your hybrid car battery charging comparison earlier in the thread! ;)

Link to comment
Share on other sites

...

And unfortunately using 64-bit Vista or XP opens a whole other can of worms in terms of hardware drivers, etc.

Cheers,

~TDW

And PAE doesn't?

The only problem I've had with Vista 64bit is that Canon refuse to make a driver for my scanner for it, and that's not a problem with Windows it's a problem with Canon.

Link to comment
Share on other sites

And PAE doesn't?

PAE doesn't seem to be an issue. It's a feature of the processor that is supported by the OS via some additional APIs which don't seem to influence how "legacy" applications work.

When I went to the "System Properties" page right after installing WinXP SP3 32bit, the "Computer:" section at the very bottom said "2.75GB of RAM, Physical Address Extension". I might be wrong, but I believe that this means that PAE was enabled by default. Some other blogs were "supporting" this hypothesis, but you never know how trustworthy those sources are, so I won't make any claims here.

But what I can claim is: I am able to run the ramdisk in the memory hidden by the graphics card without having to manually enable anything related to PAE beyond the configuration of the ramdisk itself. So, currently, I have PAE running on my system and no application seems to mind.

The way I think of it (which may not be accurate) is: PAE (or better: the AWE API) is the modern version of DOS/4GW (remember those days?). It's an additional feature set that doesn't really change how the system works unless the application specifically asks to use it.

My system is still 32bit Windows and uses all the 32bit software and drivers without any problems.

I'm sure it'll be just a matter of time before hardware manufacturers will HAVE to support 64bit... but we're not there yet.

Cheers,

~ TDW

Link to comment
Share on other sites

PAE doesn't seem to be an issue. It's a feature of the processor that is supported by the OS via some additional APIs which don't seem to influence how "legacy" applications work.

...

Unless the applications interact directly with drivers or such, they won't care, old Win95 apps will work fine on Vista x64, as long as they don't make assumptions when talking to drivers (as in, not via the windows API)

Even then, PAE requires compatible drivers, and it's not enabled by default.

(Please correct me if I'm wrong Brandon)

Why does that look like the Firefox Myths site..?!

Because it's done by the same guy.

Link to comment
Share on other sites

Because it's done by the same guy.

And, I suppose people still believe this guy's 'myths' even though he was proved wrong at least 99% of the time..?!

Link to comment
Share on other sites

Proved wrong? :blink: Um pointing to resources, say MS or blogs/articles written by people that have actual credintals for example that clearly state why some tweak does not work, etc.. Proves that the myth is correct how???

Dude whatever you want to fool yourself with -- if you like to think that crap like putting a superfetch value in your XP reg enables it :rolleyes: you go ahead and have fun with your superfetch enabled XP, etc.. etc..

Why don't you just point out a few of listings on that xp myth site that are correct.. Since you say 99% of them are :rolleyes: So you looking forward to the easter bunny coming this year? What was your fav thing santa brought you? :rofl:

Link to comment
Share on other sites

Well, seeing as how I primarily use Vista and only go back to XP when something refuses to run in Vista even forcing it into compatiability mode...but like on another forum I am on I'll do the mature thing and put you in my ignore list!

And, of course anyone else who quotes this!

Link to comment
Share on other sites

Proved wrong? :blink: Um pointing to resources, say MS or blogs/articles written by people that have actual credintals for example that clearly state why some tweak does not work, etc.. Proves that the myth is correct how???

Dude whatever you want to fool yourself with -- if you like to think that crap like putting a superfetch value in your XP reg enables it :rolleyes: you go ahead and have fun with your superfetch enabled XP, etc.. etc..

Why don't you just point out a few of listings on that xp myth site that are correct.. Since you say 99% of them are :rolleyes: So you looking forward to the easter bunny coming this year? What was your fav thing santa brought you? :rofl:

Come on Budman. Lets move on. Its not nice to keep trying to agrivate him. He doesnt believe you and the others in this thread, so just leave it at that.

Well, seeing as how I primarily use Vista and only go back to XP when something refuses to run in Vista even forcing it into compatiability mode...but like on another forum I am on I'll do the mature thing and put you in my ignore list!

And, of course anyone else who quotes this!

Mate, you where given good advise. You chose to ignore it, that is fine. No need to go putting people on ignore lists. Just walk away and move on.

Edited by Rich
Link to comment
Share on other sites

I'm sure it'll be just a matter of time before hardware manufacturers will HAVE to support 64bit... but we're not there yet.

Aren't we, if we exclude legacy products?

I think people need to stop clinging to the past.

Link to comment
Share on other sites

I think people need to stop clinging to the past.

You got a point... Except: Clinging to the past is sooo much cheaper! ;)

--- change of topic ---

This seems to be the perfect place for a little social experiment:

Let me restate the part of the original question of this topic that hasn't been answered yet:

Is it possible to place the Windows pagefile onto a ramdisk?

There are two possible useful answers to this question:

a) No, because <insert objective, detailed, technical explanation here, preferably with references>

b) Yes, here's how: <insert step-by-step instructions>

Let's see how many posts it takes to answer this question rather than "does it make sense to do so?", "is Vista better than XP?", "is MS stupid about memory management?", "are ostriches behaving maturely?"... ;)

Ready, set, GO!

Thank you for your participation!

~ TDW

PS: allan, in your first reply on this thread you said it IS possible to place the pagefile onto a ramdisk. Do you know how?

Link to comment
Share on other sites

That's how I ended up here (second hit)... Notice how in pretty much all the search results, people end up discussing why or why not to do it rather than how, which usually is the initial question? I find that sociologically very interesting.

Usually there are one or two people who say: "Yeah, I've done it. It's not a good idea...". But unfortunately no word on how they did it. Some people explain how to make a ramdisk. But no-one talks about moving the pagefile onto it. It's possible that it should be really trivial and that I have problems with it for no real reason. That would explain this.

You said you ran some benchmarks on this. Were you able to tell Windows to use only the ramdisk for the pagefile? Whenever I set that up in the "Virtual Memory" options and reboot, Windows instead ends up putting a 2.75GB pagefile.sys back on my C: drive and nothing on the ramdisk. Under "Performance Options" it will say: "Total paging file size for all drives: 2885MB". But under "Virtual Memory" the setup will still look the way I actually wanted it to be (512MB on R:, nothing on C:). If I then set the ramdisk to "no paging file" and then back to "custom size: 512MB", Windows will create a pagefile on the ramdisk. But I can't disable the pagefile on C: without rebooting. And when I reboot things are back to 2.75GB on C:. It's really frustrating. (If it helps, I can attach some screenshots. Is there some log file that I can check, too?)

What I was able to get done is to move my temp folders and my internet cache onto the ramdisk. That gave Firefox a noticeable boost and I will never again have to worry about clearing out the browser cache.

For completeness:

- To move your temp folders, modify the "Value" of the "Variables" "TEMP" and "TMP" in the "User variables" of the "Environment Variables" under "Advanced" "System Properties".

- To move the browser cache in Firefox, navigate to "about:config" and add a "New" "String" key with "preference name" "browser.cache.disk.parent_directory" and "value" "<directory, e.g: R:\TEMP>".

Thanks,

TDW

PS: Since this forum is the second hit in the Google search on this question, wouldn't it be awesome if people could find a solution here? :) That's why my initial post was so lengthy about how to at least get the ramdisk going and why I'm including the temp folder and Firefox stuff here.

Link to comment
Share on other sites

The solution is here and has been here since the beginning of the thread -- it is UTTERLY pointless to do such a thing! ;) That is the answer people looking to do such a thing should come away with.

Link to comment
Share on other sites

The solution is here and has been here since the beginning of the thread -- it is UTTERLY pointless to do such a thing! ;) That is the answer people looking to do such a thing should come away with.

That's EXACTLY the answer I was looking for! Thanks! ;)

BUT: In case anyone cares, I found out why I was having trouble and I now understand why noone ever talks about how to move a pagefile onto the ramdisk: Because it IS as dirt-simple as it should be, UNLESS you happen to have chosen your ramdisk to be drive letter B: (which was conveniently available on my system). So, even though you can use the Disk Manager to mount any drive you like (other than root) as B:, Windows will not allow you to put a page file onto that drive letter. Now, why that is, don't ask me. Must be left-overs from the time when A: and B: were reserved for floppy disks...

Now why am I doing this? I'm going to try to be as objective about this as I can. Therefore, I will prefix every statement with the appropriate restrictions (you might disagree with these, but they apply to me personally and I won't change my mind about them ;)). None of the statements (excluding the restrictions) are based on my personal opinion, though. They are based on my observations from my systems where I am running this. I should be able to back up most of them with screenshots.

Here are my thoughts:

Benefits:

If you have 32-bit Windows and don't want to upgrade to 64-bit for financial or driver-availability reasons:

Putting a pagefile onto a PAE-ramdisk that sits in the memory that Windows cannot see, i.e. above 3.5GB, is the closest you can get to making that memory available for yourself. If you keep the ramdisk small enough to be entirely in the inaccessible memory, you will NOT incur a significant memory penalty for having the ramdisk, which is the main argument I have heard against doing this. I say "significant" because the driver itself does use up a couple Megs.

This point does not hold if you use software that uses the AWE API to make use of the "hidden" memory. I have no information about which 32-bit applications do this. It is my understanding that very few do, but don't take my word for it.

If you want to keep a page-file or can't find a way to turn it off:

You can reduce the amount of disk-writes to your harddisk. This can have several benefits:

- Slightly lower power consumption

- Less noise (not applicable for SSDs)

- Less wear on the drive (especially for SSDs without wear leveling)

- Performance increase when Windows does start paging (may be subjective)

- A couple extra Gigs available on your harddisk (relevant for small SSDs, e.g. Eee PC)

To really get mileage out of reduced disk access, move the browser cache to the ramdisk. I can zoom around Google Maps at lightning speeds (in cached areas) without my system accessing my harddisk at all!

If smart nosy people have access to your computer:

Data that is stored on a ramdisk is truly GONE when the computer is turned off. Thus, placing the pagefile and the browser cache onto a ramdisk reduces traces of your activities left on the harddisk that an adept hacker could find long after you turn off the machine. (I don't think anyone should be able to argue this point!)

If you like to periodically defragment your harddisk (don't do this for SSDs):

One less file on your disk that you can't defrag.

If you think doing this is cool:

It's cool! ;)

Potential Problems:

If you have less than 3.5GB of memory or are using 64-bit Windows or applications that use the AWE API:

The ramdisk will REDUCE the amount of your available memory. Thus, Windows will start paging memory earlier. This will lead to an overall performance reduction (due to overhead) if these pages go to the ramdisk instead of not being paged in the first place. (This is the usual argument people give. NOTE THE RESTRICTION!!!)

Brandon Live claims it's potentially dangerous. He might be right. I guess I'll find that out the hard way. So far I haven't had any problems (which doesn't mean you won't!).

Data that is stored on a ramdisk is truly GONE when the computer is turned off. So, if you decide to keep important files temporarily on the ramdisk to be able to work with them faster, you might lose your work if your computer shuts down unexpectedly or if you forget to copy your files back to your harddisk.

My personal conclusion:

Given my configuration (>3.5GB RAM, 32-bit WinXP) and my performance experiences so far, I am reporting the following:

My system is performing better thanks to the ramdisk. The biggest performance increase I am noticing is the snappiness of Firefox as it now caches to memory. The slight overall (non-Firefox) performance increase (which I have not quantified yet) that I would attribute to moving the pagefile to the ramdisk might be subjective, but I don't think so.

My harddisk is noticeably less busy. The light pretty much stays off now. The main reason I like this is because now I get the feeling that my computer is working on the disk exactly when it should be rather than randomly. This makes me feel more in control and doesn't put doubts about viruses or spyware into my head (very subjective).

I have 2GB more harddisk space. I have not lost any "Available Physical Memory" to the ramdisk.

I can very quickly process tons of files on the ramdisk.

It's super fun to run a virtual machine with the root drive on the ramdisk.

With that, I would say it's up to everyone personally whether they want to do this or not. For me, it does not seem UTTERLY pointless, but for you it might. It'll depend on system configuration, preferences, and personal "knowledge".

I should call it a night...

Cheers,

~ TDW

Link to comment
Share on other sites

Nobody said running a ram disk was pointless, there are many uses for it. What is pointless is to run a ram disk, just so you can put your "pagefile" on it..

Link to comment
Share on other sites

As I said, that is two more to my ignore list...thanks!

Wow, how old are you anyway? You've chosen to ignore people who have forgotten more than you'll ever know about Windows, yet you're on a Windows enthusiast forum. Why bother?

Link to comment
Share on other sites

Wow, how old are you anyway? You've chosen to ignore people who have forgotten more than you'll ever know about Windows, yet you're on a Windows enthusiast forum. Why bother?

As I'm sure you know, people who POST that they are putting people on their "ignore list" are simply looking for attention. Why announce it? ---- just do it!

Link to comment
Share on other sites

Nobody said running a ram disk was pointless, there are many uses for it. What is pointless is to run a ram disk, just so you can put your "pagefile" on it..

Unless you can place the ramdisk entirely in memory that is otherwise inaccessible to Windows...

Just as a thought: If you were to format the ramdisk with NTFS and turn on file-compression, could you effectively "compress" your ram or does the pagefile always stay uncompressed? I know it would add overhead, but it might help in some rare cases. Example: You have a 3GB memory system. You actively use 3.5GB of memory for some task. Usually that pages out 0.5GB, which will be quite slow. If you could have a 2GB ramdisk with a compressed pagefile, 2.5GB would be paged out, but they might all fit onto the compressed ramdisk. Even though that's 2GB of more memory being paged, the page file probably operates 10x to 100x faster than if it was on disk. That might make up for it and lead to better performance, no? Again: I know that this is an EXTREMELY unlikely case. Just a "gedanken-experiment".

So, to prevent religious sidetracks about how unlikely this truly is, let me restate the question I would like to know the answer to:

If you have a pagefile on a compressed NTFS volume, will Windows compress the pagefile?

~ TDW

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.