Extra RAM and RAMDisk

WaiWai

Senior member
Jul 13, 2004
283
0
0
Extra RAM and RAMDisk

Since RAM is cheap now, I wonder if I should buy extra RAM just for the sake of RAMDisk (RAM-made virtual hard disk created by software, which is much faster than the traditional hard drives). I want to use RAMDisk to boost my system performance.

1. I wonder how many benefits I can get from the RAMDisk (and whether it justify the costs). So far it appears the use of RAMDisk is very limited - Assigning cache/temporary files to RAMDisk or running portable apps from RAMDisk.

Regarding the cache, I wonder its usefulness. Does browsing become much faster simply because I assign the cache to the RAM? What if I hibernate my computer? All cache will be erased so they need to be re-downloaded when I visit the same site.

Regarding running portable apps, how much faster if I run the portable app from the RAM (rather than the hard disk)? Portable apps don't actually read and write much from and to the hard disk. Not really helpful, isn't it?
Another problem is those portable apps (stored in RAM) will be erased every time the computer is off. So perhaps I need to keep a copy in hard disk. Every time I start my computer, I need to copy the portable app to the RAMDisk. Does the performance gain justify me to do this?

2. Is it possible to run installed apps from RAMDisk? Some installed apps may read from/write to the hard disk a lot so it would be helpful. If so, how?


3. What else can I use for RAMDisk? Please shred me some light.
Is there any good site which discuss RAMDisk usage guide or RAMDisk tips?
I googled but all those so-called guides don't enlighten me any. It appears the greatest tip they give is to assign cache / temporarily files etc. to RAMDisk.


4. What RAMDisk should I use? What are the advantages and disadvantages of different RAMDisk (both freeware and shareware)?
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
The only benefit that a RAM disk will provide is for applications that actually do intermediate I/O to disk.

Most OS will use the available memory for programs, caching and stack space before heading to disk. Use of a RAMdisk for such operations will only slow down the system.


In the olden days, some RAM disk programs were useful - with the new 32 bit OSs, use of them for memory conservations/speedup is psychological and a $ waster.
 

WaiWai

Senior member
Jul 13, 2004
283
0
0
To clarify, the RAMDisk I'm talking about is RAM-made virtual hard disk which is much faster than the traditional hard drives.
We need a software which will use portions of my RAM to create a virtual hard disk.

Essentially it is not dead.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Such a monster exists and is useful for scratch I/O

A thing to be concerned is that the data stored is not saved and the file system must be reinitialized every restart of the OS.
 

0roo0roo

No Lifer
Sep 21, 2002
64,795
84
91
considering how cheap memory is main system ram is 3+gb easy these days.
hitting the swap file so much that it becomes sluggish isn't something most people have to worry about much
sure you might get a little speed boost, but you'd also get speed boost from buying one of those ssd memory harddrives, perhaps running them in raid as well:p or this http://www.fusionio.com/
 

WaiWai

Senior member
Jul 13, 2004
283
0
0
Why should I buy hardware RAM when I can use software to create virtual RAM drive?

 

JonnyBlaze

Diamond Member
May 24, 2001
3,114
1
0
Originally posted by: WaiWai
Why should I buy hardware RAM when I can use software to create virtual RAM drive?

Because you wont take ram away from programs that may need it causing more swapping in the process.

 

WaiWai

Senior member
Jul 13, 2004
283
0
0
Originally posted by: JonnyBlaze
Originally posted by: WaiWai
Why should I buy hardware RAM when I can use software to create virtual RAM drive?

Because you wont take ram away from programs that may need it causing more swapping in the process.

But in my situation, it is because I have plenty of RAM to spare, that's why I want to create virtual RAM drive. It doesn't make sense to buy hardware RAM drive unless they have benefits over software RAM drive that I don't notice.

Software RAM drive is clearly more flexible. You can also configure exactly how much RAM you want to use to make virtual hard drive.
 

jonmcc33

Banned
Feb 24, 2002
1,504
0
0
Originally posted by: WaiWai
To clarify, the RAMDisk I'm talking about is RAM-made virtual hard disk which is much faster than the traditional hard drives.
We need a software which will use portions of my RAM to create a virtual hard disk.

Essentially it is not dead.

And with what would you use it? Most software that would benefit is going to use more storage space on the hard drive than how much RAM you have available.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You might see a decent performance increase if you're writing to the same dataset over and over, but at the beginning you'll still need to copy it from somewhere and in the end you'll still have to copy it all back to something persistent. Skipping the ramdisk and letting the filesystem cache do it's thing should be good enough unless the app you're using is really poorly written.
 

jonmcc33

Banned
Feb 24, 2002
1,504
0
0
Originally posted by: WaiWai
Let's say I have 4GB. Perhaps assign 2GB as the RAM drive.

For what application is that small that you'd really need and benefit from faster performance? It would be a waste for file transfer and even on a RAM drive it has to go through the memory controller and CPU and back to RAM.

 

GrumpyMan

Diamond Member
May 14, 2001
5,780
266
136
I use a Gigabyte I-Ram drive with 4 gigs of DDR2 with BCC MailManager, which is a CASS certifying and Presorting software used on addresses for mailings. I only put the USPS Zip+4 data, DPV and LACs Link database files of the software (files from the USPS that are used to compare your addresses to, which verify their validity before mailing) on the I-Ram drive which it calls the data from. Without the I-Ram drive it takes me 11 minutes to CASS and presort 50,000 records and that is on a Dell Optiplex 745 with 2 gigs of system ram and an E6600 Core2Duo, on the other hand with the I-Ram drive in it only takes 17 seconds.
So I guess it all depends on the application with which you are using it for as the other peeps have said. Would I have gotten the same results using Windows to make a ram drive? Don't know will have to test it, but I somehow don't think so. Will have to get back to you on that one.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Would I have gotten the same results using Windows to make a ram drive? Don't know will have to test it, but I somehow don't think so. Will have to get back to you on that one.

The results should be very similar, if not the same.
 

SunnyD

Belgian Waffler
Jan 2, 2001
32,675
146
106
www.neftastic.com
Originally posted by: Nothinman
Would I have gotten the same results using Windows to make a ram drive? Don't know will have to test it, but I somehow don't think so. Will have to get back to you on that one.

The results should be very similar, if not the same.

Depends - since your machine only has 2GB of RAM to begin with, no. But if you have 6GB in your machine and create a 4GB ramdrive, I'm betting it will be equivalent - maybe faster since you're not going through a peripheral bus...

To the OP... keep in mind having a ramdrive will help non-paged data only. Most applications will page simply on principle, so your best (and worst) move would be to migrate your page file to a ramdrive. Of course the alternative is just to throw as much RAM as you can at your OS and give it plenty of reason to NOT page data to begin with. If you're looking at dropping 4GB in your machine, just put a 64-bit OS on it and let it use the RAM as RAM. When you start carving ramdrives reducing your available memory just for storage, you're going to start causing page faults not only in the application you're trying to speed up, but also with the OS and background applications which will all be disk-bound, and they will get paged to virtual memory, which is disk-bound, and will slow down your machine more than putting the data in a ramdrive speeds it up.

I would suggest either a solid-state drive, or if you really REALLY want to and can afford to throw as much RAM as possible at a machine, load one out with 32GB or more and carve out a significant (16GB or more) slot to move your virtual memory (and OS if possible) to it, along with whatever applications you want. Of course god forbid your machine crash...
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Depends - since your machine only has 2GB of RAM to begin with, no. But if you have 6GB in your machine and create a 4GB ramdrive, I'm betting it will be equivalent - maybe faster since you're not going through a peripheral bus...

That's a pretty big assumption considering that he doesn't even say how big the dataset he's sorting is.

To the OP... keep in mind having a ramdrive will help non-paged data only. Most applications will page simply on principle,

Applications don't page on their own, the OS does it for them. Some will try to outsmart the VMM like Photoshop but they usually just end up making things worse and you end up with bad hacks like "scratch disks".

so your best (and worst) move would be to migrate your page file to a ramdrive.

If it's a standalone drive like the I-RAM then it might not be a terrible idea, but moving it to a software RAM drive is just incredibly stupid. If your dataset already fits into memory then the OS will never page anything to disk anyway. And the pagefile is only a chunk of where your paging comes from, if the OS decides that memory is tight and starts evicting shared libraries, executables, etc from memory you'll still be paging back in from disk when it needs them.
 

WaiWai

Senior member
Jul 13, 2004
283
0
0
Originally posted by: Nothinman
Would I have gotten the same results using Windows to make a ram drive? Don't know will have to test it, but I somehow don't think so. Will have to get back to you on that one.

The results should be very similar, if not the same.

It should be the same since you access it from RAM as a matter of fact.
The problem is you need to copy back and forward every time you power it off and on again. But the speed of copying is fast so it isn't too painful.

As to hardware RAM drive (eg i-RAM), I realise the data will be kept even if I shut down the computer. But what if I turned off the power supply too? Will the data be gone after several hours?
 

WaiWai

Senior member
Jul 13, 2004
283
0
0
The problem about the applications even if I have plenty to RAM (eg 3GB*). Some applications will still use the disk even if the RAM is not used up. For example, application may still write files (cache) in hard drives no matter how much RAM you have. You need to configure so they write those cache on your RAM drives.

If your dataset already fits into memory then the OS will never page anything to disk anyway.
Tell me if I'm wrong. But OS will still use paging (not only when RAM is insufficient) unless you switch it off completely. I am also wondering if it is a good idea to switch off paging completely (don't use virtual RAM at all) since I have plenty of RAM (3GB*).

The reason why I want to use RAMDisk is I want to keep accessing to/from hard drive at the minimal. As long as I can tell the OS and all apps to use RAM (instead of hard drive) when they are running, I'm fine with it.


*: I realise 32-bit OS can't make use of all 4GB, and I'm not ready to use 64-bit OS (application and drive compatibility issues). So I think I will only get 3*1GB DDR2 RAM at max.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Tell me if I'm wrong. But OS will still use paging (not only when RAM is insufficient) unless you switch it off completely. I am also wondering if it is a good idea to switch off paging completely (don't use virtual RAM at all) since I have plenty of RAM (3GB*).

You can't switch off paging, paging isn't a bad thing, it's how the system gets data to/from memory. The same goes for Virtual Memory. Get a copy of Inside Windows or Understanding the Linux kernel and read the chapter on memory management.

The reason why I want to use RAMDisk is I want to keep accessing to/from hard drive at the minimal. As long as I can tell the OS and all apps to use RAM (instead of hard drive) when they are running, I'm fine with it.

The OS is already caching all reads and writes into main memory, sure they hit disk eventually and that may slow them down a bit but if your performance requirements are that high you probably need to rethink your whole setup.

*: I realise 32-bit OS can't make use of all 4GB, and I'm not ready to use 64-bit OS (application and drive compatibility issues). So I think I will only get 3*1GB DDR2 RAM at max.

You realize wrong, a 32-bit OS that fully supports PAE can access up to 64G of physical memory.
 

SunnyD

Belgian Waffler
Jan 2, 2001
32,675
146
106
www.neftastic.com
Depends - since your machine only has 2GB of RAM to begin with, no. But if you have 6GB in your machine and create a 4GB ramdrive, I'm betting it will be equivalent - maybe faster since you're not going through a peripheral bus...
---
That's a pretty big assumption considering that he doesn't even say how big the dataset he's sorting is.

I agree, but since the OP's hypothetical constraint said 4GB, I ran with it with the assumption that the dataset would fit.

To the OP... keep in mind having a ramdrive will help non-paged data only. Most applications will page simply on principle,
---
Applications don't page on their own, the OS does it for them. Some will try to outsmart the VMM like Photoshop but they usually just end up making things worse and you end up with bad hacks like "scratch disks".

True, but again, given the current OS - Windows in this case, I seriously doubt that it is intelligent enough to effectively run without paging even with an ample amount of memory. Especially since 32-bit applications have a 2GB address space which is then virtualized by the OS - meaning that if the APP goes over 2GB for whatever reason, a page-fault will occur. Again, limited to large apps or large datasets, but it doesn't matter if you have 256MB or 256GB, the APP will cause paging at that point.

so your best (and worst) move would be to migrate your page file to a ramdrive.
---
If it's a standalone drive like the I-RAM then it might not be a terrible idea, but moving it to a software RAM drive is just incredibly stupid. If your dataset already fits into memory then the OS will never page anything to disk anyway. And the pagefile is only a chunk of where your paging comes from, if the OS decides that memory is tight and starts evicting shared libraries, executables, etc from memory you'll still be paging back in from disk when it needs them.

Exactly why I said "best (and worst)". Honestly, the problem with paging is drive latency and "thrashing" since there usually isn't any good rhyme or reason as to where data gets dumped in virtual memory. In this regard, moving the page file would be suited well to a RAM drive, simply from the random IO standpoint. But again, if you HAVE the RAM to devote to a RAM drive, why not let the system utilize it so you simply don't use the page file as much?

In my opinion, just let the system use what it can and if the throughput isn't enough - that's what SSD's are for.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
True, but again, given the current OS - Windows in this case, I seriously doubt that it is intelligent enough to effectively run without paging even with an ample amount of memory. Especially since 32-bit applications have a 2GB address space which is then virtualized by the OS - meaning that if the APP goes over 2GB for whatever reason, a page-fault will occur. Again, limited to large apps or large datasets, but it doesn't matter if you have 256MB or 256GB, the APP will cause paging at that point.

You really need to read up on memory management, VM and paging. It's 100% impossible to disable paging and VM in i386 protected mode so no, Windows can't "effectively run without paging". Each 32-bit process has 4G of VM available but by default 2G of that is reserved by Windows so only 2G is available to the process, this is adjustable with the /3GB boot.ini switch to make it a 3/1 split (the default in Linux) but it only really affects processes that are marked large address aware. Also, paging is just the method that the OS uses to get data to/from memory so when a binary is first executed it's demand paged into memory, when you open a file it's demand paged as the process reads it, when a library is used it's demand paged into memory. And none of that paging has any correlation to the size of the process' VM space, page faults happen by the hundreds per second and that's just normal. From midnight to now my home machine has an average of 3593 page faults/s according to sar.
 

SunnyD

Belgian Waffler
Jan 2, 2001
32,675
146
106
www.neftastic.com
Originally posted by: Nothinman
True, but again, given the current OS - Windows in this case, I seriously doubt that it is intelligent enough to effectively run without paging even with an ample amount of memory. Especially since 32-bit applications have a 2GB address space which is then virtualized by the OS - meaning that if the APP goes over 2GB for whatever reason, a page-fault will occur. Again, limited to large apps or large datasets, but it doesn't matter if you have 256MB or 256GB, the APP will cause paging at that point.

You really need to read up on memory management, VM and paging. It's 100% impossible to disable paging and VM in i386 protected mode so no, Windows can't "effectively run without paging". Each 32-bit process has 4G of VM available but by default 2G of that is reserved by Windows so only 2G is available to the process, this is adjustable with the /3GB boot.ini switch to make it a 3/1 split (the default in Linux) but it only really affects processes that are marked large address aware. Also, paging is just the method that the OS uses to get data to/from memory so when a binary is first executed it's demand paged into memory, when you open a file it's demand paged as the process reads it, when a library is used it's demand paged into memory. And none of that paging has any correlation to the size of the process' VM space, page faults happen by the hundreds per second and that's just normal. From midnight to now my home machine has an average of 3593 page faults/s according to sar.

I am quite familiar with this, thank you.

By the way, you can easily turn off paging in Windows. Try it some time, it's under System Properties -> Advanced -> "Performance Settings". I wouldn't suggest doing so...
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I am quite familiar with this, thank you.

You may be familiar with it but you still don't seem to understand some of the basic differences in terms. Read the memory management chapters in Inside Windows or Understanding the Linux kernel and you'll see what I mean.

By the way, you can easily turn off paging in Windows. Try it some time, it's under System Properties -> Advanced -> "Performance Settings". I wouldn't suggest doing so...

That's not paging, that's the pagefile.