How to choose the right RAM disk size

Started by Deb

Deb

How to choose the right RAM disk size   25 April 2018, 17:44

Good day. Please help me understand the criteria to determine the size of a ram disk in the following scenario.

Suppose I want to use a portable version of an Internet browser in a RAM disk. The self-contained folder of the browser is, say, 200 MB in size, so I create a 300 MB ram disk and copy the browser folder into it.
However, I am wondering about the usefulness and consequences of this procedure if the RAM usage of the program exceeds the size of the RAM disk. Should the RAM disk size be based on the RAM usage of the program rather than the size of the program folder itself?

Thank you for your attention.
SoftPerfect Support forum - Andrew avatar image

Re: How to choose the right RAM disk size   25 April 2018, 19:38

The general answer:
the size of the RAM disk should be large enough to fit both the program files/folders and all the temporary and usage-related files that program creates during its functioning.

The advice for your particular situation:
it doesn't really make sense to place the browser itself on a RAM disk. It might start a bit faster when placed on a RAM disk, but you normally launch it only once and then use it all day.

Instead what makes sense is to place the browser's cache on the RAM disk (the cache is where the browser keeps temporary copies of web-pages). Because there is a significant amount of reading and writing into the cache, having it on a RAM disk generally improves browsing speed, and protects your physical disk from excessive wear.

Size-wise, the bigger the better (within the reasonable limits of the free RAM availability), but 200-300 MB for a browser cache should suffice. We have developed a small utility that helps relocate a browser cache to a RAM disk, though it probably won't work with a portable browser - it is designed to work with normally installed Chrome, Opera or Firefox.

Please see this article where we explain how to use a RAM disk and improve web-browsing.
Deb

Re: How to choose the right RAM disk size   27 April 2018, 00:20

Thank you for your prompt and informative reply.

Still, just for completeness' sake, I was wondering if you could explain how Windows will respond if the program's RAM usage exceeds the size of the RAM disk. Perhaps I may be confusing different concepts? Thank you for your attention.
SoftPerfect Support forum - Andrew avatar image

Re: How to choose the right RAM disk size   27 April 2018, 10:42

There are two different concepts here:

1. Program running out of RAM, which can happen whether you use a RAM disk or not. Running any program on any computer requires a certain amount of RAM (memory). For example, if you open a number of tabs in your web-browser, that would require quite a bit of RAM. (The computer may not have any RAM disks at all, but if it does, the RAM will come from the segment of RAM not occupied by the RAM disks; i.e. free RAM not taken by anything else.) When there is no more free RAM left, Windows will attempt to swap out memory to a file on the hard disk and the computer may become slow. If a program requires even more RAM, the allocation may fail and the program crashes. Again, this happens on any computer, with or without RAM disks.

2. Program running out of disk space, which can happen on a RAM disk or a regular hard disk. For example, if you placed a program on a RAM disk and it started creating a lot of files. Once the RAM disk is full, no more files can be created and Windows will show a "disk full" error. Then, depending on the quality of the program, it will either crash because the developers never expected that to happen, or will gracefully shutdown and notify you about the disk space shortage problem.

RAM disk is essentially a way to use some of the RAM as a disk. RAM disk software creates a segment in the RAM that, from the point of view of the operating system, looks and functions like a hard disk. This is normally done on the computers that have more than enough RAM for all the installed programs to operate. With a RAM disk in place, instead of writing, for example, web browser temporary files on the hard disk (which is slower than RAM and has a limited number or write cycles), the system writes those files on the RAM disk, in RAM (which is faster and has unlimited write cycles), which means the life of the real hard disk is prolonged and the web-browser operates faster. In a situation when the size of the RAM disk is smaller than the program requires, the consequences are the same as if your computer didn't have enough space on the real hard disk.

In the end, a RAM disk behaves exactly like a regular disk drive, except it is volatile and is much faster because it's in RAM. If a program runs out either of memory or disk space, it will most likely terminate because the resource it needed was not available.

The bottom line is you should use RAM disks only if your computer has enough RAM.
Deb

Re: How to choose the right RAM disk size   27 April 2018, 14:02

Most enlightening! Thank you very much for your explanation!

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 ********  **    **  **      **        **  **     ** 
 **    **   **  **   **  **  **        **  **     ** 
     **      ****    **  **  **        **  **     ** 
    **        **     **  **  **        **  **     ** 
   **         **     **  **  **  **    **  **     ** 
   **         **     **  **  **  **    **  **     ** 
   **         **      ***  ***    ******    *******  

Message: