Add a RAM Disk to Your Computer for Faster-than-SSD Performance

^^ You won't get any advantage just by launching apps from a RAM disk if the app is again going to use the swap file which is on the HDD. However if you have the swap file on RAM, that can be a major boost.

I used RAM disks many years back during the Windows 95/98 era using the RAMDRIVE.SYS driver that gets supplied with the OS. The disk was created before windows start up and was available to windows by the time its booted.

With my latest rig, I wanted to do the same i.e create a 8GB RAM Disk and put the swap file on it. But the newer RAM disk software get kicked in during windows load and windows already wants to use the page file by that time. Since the drive letter for the RAM disk is not yet available, windows just gives a warning and creates the swap file on the OS partition defeating the purpose of the RAM disk.

btw, note that putting the swap file on ram does not always make sense. It makes sense for apps that make allocations to virtual memory directly.

Lastly, I am not sure why you created this thread in the news section. Its not like its a new concept.
putting the swap file on ram disk doesnt make any sense at all to me... :facepalm:

instead just disable the swapspace altogether if you have a lot of ram. thats what I did.
 
putting the swap file on ram disk doesnt make any sense at all to me... :facepalm:

instead just disable the swapspace altogether if you have a lot of ram. thats what I did.

Yeah, you are right in most cases, it doesn't. But some apps rely on virtual memory backed by the page file being available and they can fail if this is removed. Don't make the assumption that every app is capable of making the most out of Physical memory. Memory management is not only up to the OS, but also the app as well to some extent. I keep a swap file despite having 16 GB RAM.

@saifbukhari
Trying to put the swap file on RAM disk doesn't make sense now because as I said, with latest windows versions, it seems the RAM disk drivers cannot kick in and make the drive available before windows starts needing the swap file during the boot process. So it made the attempt pointless and so I had no means of bench marking such a setup on the latest windows to see if it even makes any improvement.

But yeah, don't follow the above advice of disabling swap file all together. It can cause various sorts of problems.

1. Certain resource intensive apps may not run properly.
2. A misbehaving/leaky application an leak memory causing you run out of RAM even with 8 GB or more. If physical memory runs out, you would run into a hard crash without having any chance to recover if you are in middle of some work. With swap file enabled, it would at least continue for some more time may be running slowly, but at least affords you some extra time to notice the symptoms and perform some action.
 
Yeah, you are right in most cases, it doesn't. But some apps rely on virtual memory backed by the page file being available and they can fail if this is removed. Don't make the assumption that every app is capable of making the most out of Physical memory. Memory management is not only up to the OS, but also the app as well to some extent. I keep a swap file despite having 16 GB RAM.

@saifbukhari
Trying to put the swap file on RAM disk doesn't make sense now because as I said, with latest windows versions, it seems the RAM disk drivers cannot kick in and make the drive available before windows starts needing the swap file during the boot process. So it made the attempt pointless and so I had no means of bench marking such a setup on the latest windows to see if it even makes any improvement.

But yeah, don't follow the above advice of disabling swap file all together. It can cause various sorts of problems.

1. Certain resource intensive apps may not run properly.
2. A misbehaving/leaky application an leak memory causing you run out of RAM even with 8 GB or more. If physical memory runs out, you would run into a hard crash without having any chance to recover if you are in middle of some work. With swap file enabled, it would at least continue for some more time may be running slowly, but at least affords you some extra time to notice the symptoms and perform some action.

And I dont think disabling virtual memory will cause any problem.

1. I dont think so.
2. memory leaking apps doesnt crash system. and it doesnt matter if you have swap or not leaking app will cosume memory. you can try it yourself by writing a simple c program.
 
You can not install an OS over a RAM Disk. RAM Disk works on top of an OS and OS execution is limited on the media on which it is installed. Do the comparison.
When I'm only going to do routine work (browsing/email/chat/music/movies, or want to test something) I boot Win7 from ramdisk (firadisk).
See : https://sites.google.com/site/gbraosite/images1/nil7ram.png

If you are booting XP from memory, it is possible to save changes to drive C: to the image/drive you loaded into memory.

After experiencing boot from memory, I never feel like booting from hdd.
 
The only use of a ram disk as I can see is for the browser cache. I don't see any other use for it. Swap is useless. If the machine has 8/16gigs of ram or more, I simply turn off swap as it is not required anymore.
 
^ the idea of ram disk will work only if the storage is battery backed. you can create a 10GB ramdisk and install games in it and it would be crazy efficient but it has to be battery backed else power cut will corrupt the volume. So if there is a good ups that has enough backup that you can shutdown the pc everytime ram disk would be a great idea.
 
And I dont think disabling virtual memory will cause any problem.

1. I dont think so.
2. memory leaking apps doesnt crash system. and it doesnt matter if you have swap or not leaking app will cosume memory. you can try it yourself by writing a simple c program.

First of all you cannot disable virtual memory, you can only disable the swap file. the swap file is secondary storage back up and extension for the virtual memory. The OS can move stuff between physical and virtual memory and if required, move the stuff in virtual memory to disk so it can free RAM. But as I said before, apps can also make allocations to virtual memory directly.

1. Apps that try to make several large Virtual memory allocations can fail without a backing page file if the allocations cannot be accommodated in the RAM part of the virtual memory. I am not sure about the current situation, but some years back there were apps that used to fail doing certain operations after running out of virtual memory in the absence of a backing page file.

2. Memory leaking apps can very obviously crash the system. I am not sure where you got the idea that leaking apps don't crash the system, but its is a pretty normal scenario for programmers working on large code bases. On a normal system, when the system is running low on memory due to a a leaky app, it starts clearing out as much stuff to page file as possible in order to make room in the RAM and during this phase the the system starts becoming slow and there would be too much disk activity, but after reaching a point when it runs out of virtual memory, the applications running on the system would crash and the only thing you can do is restart the system. Without a page file, this would happen much sooner. In fact at my previous company they used to do test runs of the server software (which was written in C++) on machines which don't have swap file enabled. The same app which used to take 2~3 days to crash the system in presence of unlimited swap file would result in crash in less than a day without the swap file. In fact this app also used to do large allocations in virtual memory

Lastly, I agree that It is debatable whether limiting your RAM and then using the rest to use hold the swap file makes sense in this day and I cannot tell that for sure without testing (I have no means of testing it anymore), but disabling the swap file altogether does not give any advantage either and also runs the risk of getting you into potential problems. The performance part it at least seems to be well proven and you will find quite a few links which show that there is no performance benefit to be had by disabling the page file.

For for your Info, here are some things that I have tried over the years with regard to RAM disks and page file usage.

1. Putting caches in RAM disk - Improves performance for apps that use them.
2. Running apps from RAM disk - no use for running large apps that are bottle necked else where. For small apps you don't need to run from RAM disk.
3. Putting swap file in RAM - It seemingly improved performance, but largely limited by the amount of RAM available in those days. No means of testing it in an extensive manner.
4. Disabling swap file - Run into problems with certain apps in the past and also encountered out of memory while running Crysis with other resource apps running in the background. This was with 6 GB RAM on the machine.
5. Fixed size swap file - No apparent performance improvement.
6. swap file on different HDD than OS - improves performance
7. Swap file on fast HDD - Improves performance.
 
First of all you cannot disable virtual memory, you can only disable the swap file. the swap file is secondary storage back up and extension for the virtual memory. The OS can move stuff between physical and virtual memory and if required, move the stuff in virtual memory to disk so it can free RAM. But as I said before, apps can also make allocations to virtual memory directly.
The bold part is wrong. There is only one guy in the operating system that takes care of paging. its called the VMM or Virtual Memory Manager in Windows. I would like to quote few lines from a very famous book by an indian. To simply put VMM is the boss managing memory which includes paging. applications cannot simply mess with paging.
RajivNagar said:
The Virtual Memory Manager (VMM) has the responsibility for providing all of this functionality. The VMM is so named because it helps provide an abstraction to each application executing on the system: each application can perform its tasks believing all of the memory resources on that system are available for the sole use of that application. Furthermore, the application can execute believing that it has an infinite amount of memory resource available to it. This abstraction of an infinite amount of memory reserved solely for the use of a specific application is called virtual memory. The VMM is the kernel-mode component responsible for providing this abstraction.

It determines the policies for working-set management of physical memory allocated to processes. Furthermore, all physical memory allocation/deallocation decisions are performed by the NT VMM. This is done irrespective of whether memory is allocated to user-mode applications or for kernel-mode file data caching.
1. Apps that try to make several large Virtual memory allocations can fail without a backing page file if the allocations cannot be accommodated in the RAM part of the virtual memory. I am not sure about the current situation, but some years back there were apps that used to fail doing certain operations after running out of virtual memory in the absence of a backing page file.
Yup, when the memory runs out the system thrashes. thats a known fact but having a page file/swapspace doesnt make it any better. the total available system memory would be RAM + pagefile. so if you have a leaky application it will eventually fill out the pagefile too and eventually the system will thrash. on the other hand if you dont have a pagefile, the ram will fill out and the system will thrash. unless you kill the particular application from the task manager. Here the point is, that you cannot live with apps that leak. you will have to kick them out wether you have pagefile or not. as the root cause of it is bad programming.
2. Memory leaking apps can very obviously crash the system. I am not sure where you got the idea that leaking apps don't crash the system, but its is a pretty normal scenario for programmers working on large code bases. On a normal system, when the system is running low on memory due to a a leaky app, it starts clearing out as much stuff to page file as possible in order to make room in the RAM and during this phase the the system starts becoming slow and there would be too much disk activity, but after reaching a point when it runs out of virtual memory, the applications running on the system would crash and the only thing you can do is restart the system. Without a page file, this would happen much sooner. In fact at my previous company they used to do test runs of the server software (which was written in C++) on machines which don't have swap file enabled. The same app which used to take 2~3 days to crash the system in presence of unlimited swap file would result in crash in less than a day without the swap file. In fact this app also used to do large allocations in virtual memory

Lastly, I agree that It is debatable whether limiting your RAM and then using the rest to use hold the swap file makes sense in this day and I cannot tell that for sure without testing (I have no means of testing it anymore), but disabling the swap file altogether does not give any advantage either and also runs the risk of getting you into potential problems. The performance part it at least seems to be well proven and you will find quite a few links which show that there is no performance benefit to be had by disabling the page file.

For for your Info, here are some things that I have tried over the years with regard to RAM disks and page file usage.

1. Putting caches in RAM disk - Improves performance for apps that use them.
2. Running apps from RAM disk - no use for running large apps that are bottle necked else where. For small apps you don't need to run from RAM disk.
3. Putting swap file in RAM - It seemingly improved performance, but largely limited by the amount of RAM available in those days. No means of testing it in an extensive manner.
4. Disabling swap file - Run into problems with certain apps in the past and also encountered out of memory while running Crysis with other resource apps running in the background. This was with 6 GB RAM on the machine.
5. Fixed size swap file - No apparent performance improvement.
6. swap file on different HDD than OS - improves performance
7. Swap file on fast HDD - Improves performance.

Well, disabling the pagefile saves few GBs on the SSD which is costly. which is the exact reason why I disabled page file. One more disadvantage that I observed with pagefile is that once you enable it, the os will start paging out unused memory into the pagefile causing disk ios. This paging happens eventhough your memory is not full. This kind of IO is un necessary and especially on SSDs where the life of SSD depends on the no of IOs which means you are actually killing the SSD prematurely.
 
so can anybody tell me if any ramdisk software is capable of backing up the stuff in ramdisk,like,after reboots?like games and stuff...so that after one reboots,the games installed still function properly..of course one would also have to wait a while for the software to re-install the stuff or something,right?if so,then can anybody with large amounts of RAM create a big ass ramdisk,load some games on it,and then tell me about the load times..
 
Back
Top