Can I put my swap file in a RAM drive?

If I understand what I’ve read correctly, Windows 9x doesn’t actually use any RAM beyond 512MB. Suppose I were to set up a RAM drive using the excess RAM. Could I designate that drive as the location for the swap file? As far as I can tell, this should result in much faster access to the swap file. How much extra RAM would I need to accomodate the average swap file?

I’m working under the assumptions that it isn’t necessary to preserve the swap file’s data while Windows isn’t actually using it (ie. any time I have to restart) and that I can trick Windows into accepting a RAM drive as a hard disk.

Win2K and WinXP do correctly use RAM in excess of 512MB, right?

I think the Win9x limit was more like 768 MB.

To actually answer your question, it seems to me you’d need to have some kind of program that could A) access your above-limit memory in spite of Windows (i.e. acting completely separate from Windows) and B) map a drive letter for Windows to read. I’m not sure if either of those are feasible or even possible.

The standard swap file size is usually between 1.5-2.5 times your physical RAM, depending on who you ask. You’d need to have a whole lot more than 768 MB to really take advantage.

I’m sure within 3 posts, someone will post a link explaining just how to do it. :wink:

With Win98 and 512MB of RAM, it’s possible (likely?) you don’t need a swap file at all. Try turning it off and seeing if your performance degrades. If you’re not doing heavy multi-tasking or image/video editing it should be OK.

It should work. If the ramdisk is setup in config.sys it should exist before windows loads. In your Control Panel-System-Virtual Memory just set the drive to your ramdrive.

Check here, for example.

Hauky, since the ramdisk is created before Windows boots, the Win98 mem limit shouldn’t effect things.

I just edited the relevant boot files instead of using a program to do it, but it looks like either method does more or less the same thing: create a logical drive in a portion of the system’s RAM during the boot process.

So, since it’s apparently feasible, is there any benefit to actually doing it?

MS’s ramdrive, I think, is limited to something like 32 MB, so if you want more than that, you need a third-party ramdrive driver.

I’m still skeptical that you can get around the limit this way, I guess it matters if win98’s limit is that it can only manage 512MB total, or if it can only manage the first 512MB of memory (in which case, the memory available to Windows would be 512MB - size of ramdrive, unless you can convince the ramdrive to load higher than that).

In short, I’m doubtful that any dos driver could make use of memory past the limit of 98, as I would suspect that 98’s limit comes from sitting on top of DOS in the first place.


Ok, there is a lot of misinformation here.

  1. Windows 9x (including Windows ME) does not have a 512 MB barrier. It has no problem addressing RAM over 512 MB. It does have issues with such systems however. This is due to a bug in Windows 9x’s Vcache, which Microsoft has not bothered to fix.

You can work around this by restricting MaxFileCache to 512 MB (This would give you 512 MB for file cache + the rest of your RAM for applications.)

Note: Windows 9x does not play well with RAM over 1 GB. See: Computer May Reboot Continuously with More Than 1.5 GB of RAM
2) Putting your swapfile on a ramdrive has no benefit. If Windows 9x really did have a 512 MB barrier AND you could find a ramdisk driver that would sit in highest portion of memory, you might see some benefit from a ramdrive. But even then it’s doubtful.

As Jake4 pointed out, you most likely do not even need a swapfile. You may be confusing “swapfile” with “file cache”. It’s the latter which will steal all available RAM whenever possible.

The swapfile is used whenever there is not enough memory for applications. The file cache is dynamic, and will (should) shrink if applications need more memory.

Note: With Windows 2000 or higher (maybe NT also) you MUST have a swapfile of at least 1.5x main memory. This is not because you really need it, but because 2000 doesn’t like it if you don’t. Microsoft claims that too small swapfiles on large RAM systems can lead to corrupted profiles, and I have seem flaky systems act less flaky with a proper-size swapfile (although I’m pretty sure it’s more expectation than observation).