RAM Disk

Ask questions and give answers about computers, mobile devices, game boxes, PC security and all manner of geeky stuff.
Post Reply
User avatar
yogi
Posts: 4161
Joined: 14 Feb 2015, 15:49

RAM Disk

Post by yogi » 01 Nov 2015, 07:03

RAM disk is a cute idea that I've ignored for all of my computer life until recently when I was reinstalling some motherboard utilities. The story of why I was restoring said utilities is lengthy and I may post about it in another thread. In any case I installed the RAM disk utility not knowing exactly what I'd use it for because I've never had occasion to want, need, or use it, and thus know little about it.

In a nutshell, RAM disk is a partition made inside your random access memory (RAM). In my particular case the Windows operating system and all the junk I installed along with it typically consumes 3.5 - 4.0 gigabytes of my 16.0 gigabytes total. I decided I can spare at least 4 gigabytes of the mostly unused 12 gigabytes and thus created a partition that is 4 gigabytes in size and resides in RAM. It shows up as a hard drive with the letter \:P as a designation.

The connection between RAM and the CPU is among the fastest data buses you can have internally which is why all those system files use it to keep the machine alive. If you can install something in the limited space allowed to RAM disk, you would be able to take advantage of that fast bus architecture and see improvements in performance that are quite amazing. The down side of RAM disk is that it's volatile. That means if the power is removed from the machine, anything in RAM is wiped out. Thus you don't want to install something there that cannot afford to be lost due to a power glitch. Otherwise it's an amazing way to get things done quickly.

In my experiments I decided to put all my downloads into my newly created RAM disk and do all future software installations from there. Doing this saves wear and tear on my hard drives and dramatically decreases the time it takes to install software onto my non-volatile solid state drive (SDD) where I keep my Windows operating system. All I can say is that the quickness with which I can install software now is breathtaking. Actually running software from RAM disk would be equally dramatic, I'm sure, but I've not yet thought of a good application to put there and not miss it if a power glitch wipes it out. There is enough RAM in my computer to fit an entire virtual machine LINUX install in RAM if I were daring. I may just do that some day to see how amazing it all can be. For now it's blowing me over in my limited application, but I can see a lot of potential down the road.

User avatar
Kellemora
Posts: 1801
Joined: 16 Feb 2015, 11:54

Re: RAM Disk

Post by Kellemora » 01 Nov 2015, 09:22

Hi Yogi

Many on-line games place key parts of their program in RAM.
A recent change by Adobe to their Flash Player has upset many game players who use Adobe with major game slowdowns.
I don't use Adobe's Flash Player so did not suffer from the problems created by Adobe's new Flash Player.
Apparently it is no longer leaving enough RAM allocation for the games to run properly. My guess!
The game providers have frantically tried to fix the problems, and in so doing have created tons of other problems.

One game I played off and on for years, using the May 12, 2015 version of PepperFlash, because all versions since then only have five zoom levels instead of six, removing the lowest zoom level, which makes game play almost impossible.
But PepperFlash users were not affected by the changes Adobe made to their Flash Player.
I don't know the difference between Adobe's Flash Player and Shockwave's Flash Player, I thought they were the same thing. But on my frau's Windows10 machine, I changed her Adobe Flash Player to a Shockwave Flash Player and her game speeded back up to where it should be. Could be it was an older version too, but was the newest bearing the Shockwave logo.

I keep several system monitor windows open on my machines, so I know what is doing what where and when.
I normally don't keep things like the Swap File monitor running, because it is never used.
However, most recently, I have added the monitors for Hard Drive activity and System Load. I already monitored the RAM usage.
The attempts by the game maker to fix the problem with Adobe shifted a part of their operating system from RAM to using the Hard Disk, which caused basically the same slowdown as Windows users using Adobe experienced. This is why I think Adobe's change had to do with RAM allocation space, possibly overlapping with the game, so the game had to move to the hard drive.

Unless I reboot my machines, around 75% of my RAM is used as cache. This goes up and down depending on how much RAM a running program requires. I monitor all levels of RAM, user, shared, buffers, cache, & free. User and buffers use the least amount, but anytime I view something which uses a Flash Player, at least 25% of my RAM is allocated to Flash. And if I open the game which plays in flash, most of the Cache is released to give the game around 30%.
This is all done automagically behind the scenes and I have no control over what happens.
Since my Swap File has never been used, 0% of 16gigs of swap space, I can assume I have plenty of RAM.
However, I have learned since getting the SilverYogi, more RAM means exponentially faster. The why this is so I don't understand, since the swap file is never used. Perhaps it has to do with what is held in cache?

OK, done rambling.

User avatar
yogi
Posts: 4161
Joined: 14 Feb 2015, 15:49

Re: RAM Disk

Post by yogi » 01 Nov 2015, 10:13

I have read in more than one place that increasing RAM is the single most effective way to improve system performance. There never is an explanation that goes into detail other than the assumption that more is better. When I was limiting myself to 4GB RAM the usage was typically between 2-3 GB and when I increased to 16GB RAM that same system would hover around 4GB RAM. Linux is even less demanding, and like you I've never seen swap space used. I have seen Page File usage vary in Windows which is the same idea as swap. So I don't get why more RAM is better after 4GB, but it obviously is.

RAM disk is a partition of RAM and thus denies the system or it's programs from using what has been allocated. It makes sense to run such things as Flash players out of RAM, but that's something not within my control. I don't know what Adobe did and Google didn't do, but the whole idea of taking full control of a machine, even in controlled circumstances, is a high risk security problem. I'm certain that's why Adobe changed things, but at the price of performance. It's similar to antivirus software that will protect you to some degree, but it will also degrade the overall performance of your system.

I don't know the intricacies, but it would not seem like a huge problem to get your games to run from RAM disk. Doing that would make any lagging caused by Flash moot. RAM is directly connected to the CPU and only the coding of the software itself would slow things down in that configuration. My RAM disk utility is designed for Windows, but I'm sure you can find one for Linux. If you can spare at least 4GB of Silver Yogi's memory, then you too can experiment. Who knows? You might even be able to improve on what you already have.

User avatar
Kellemora
Posts: 1801
Joined: 16 Feb 2015, 11:54

Re: RAM Disk

Post by Kellemora » 02 Nov 2015, 09:37

The only thing I can see about having more ram available than necessary is the unused ram for system and programs is utilized as a cache of programs you open and use often. This explains why they open almost instantly, but doesn't explain why everything else seems to have a boost in speed also. Unless parts of it are staying in cache that I don't know about.

Even though the slot the GFX card is in got damaged, SilverYogi is still the fastest and best machine I have here. It's a good thing the CPU had excellent video capabilities. The GFX card is A-OK, but none of my other machines have the proper power supply to run it. So I'm saving it for the next time I have to replace a mobo, or actually when ever I can afford to do so. I have two machines sitting here with the graphics out, one machine with the Ethernet out of which I replaced the on-board Ethernet with cards, and they too died, so the caps on the mobo are probably bad now too. All but one of my machines are quite old now.

As an aside, I managed to get the Dell machine to quit producing so many IO errors by using a super small older 80 gig SATA hard drive in it in place of the 1 terrabyte SATA drive. I had purchased two 1 terrabyte SATA drives, one for my daily work machine, and one for a computer down at the house to run RSync from as off-site backup after the NAS burned out. The machine I placed it in died shortly after, so I moved it to the Dell, which for me Dells have always had IO problems, every single one I've ever owned. I tried swapping the two 1 terra drives and it made no difference.
Ran across a comment on-line where someone else was having IO issues with Dells and he said when he used a 250 gig or smaller hard drive he had far fewer IO problems.
Ironically, I thought the frau's old broken computer had an IDE drive in it and I was studying to see if Clonezilla would work to move the files from an IDE to a SATA drive for her new machine. Popped the cover and found it was already a small SATA drive. I used a simple backup program to save the data from the drive, and restored a 250 gig drive, which changed it to 80 gig during the process, then I expanded the partition and her machine was back up and running. Stuck the 80 gig in the Dell and most of the IO problems went away. I left the 1 terra in it to use for file storage, but it still triggers IO problems, unless I only use it to store data via RSync.

It seems all the computer repair shops close to me only work with Windows computers now, and my favorite one is so far away and the guy who runs it is over 70 years old, so I'm almost afraid to do anything with him which requires me leaving a machine there. He's cheap enough I normally have him build me a new machine for around 300 bucks, now up around 400 bucks, so I can grab it and go. His service techs are all most Linux friendly and know their stuff, they have never steered me wrong yet.

Well, this is NaNoWriMo months so I had better get to pounding out my 2,000 words for today, lest I end up being a loser, hi hi...

TTUL
Gary

User avatar
yogi
Posts: 4161
Joined: 14 Feb 2015, 15:49

Re: RAM Disk

Post by yogi » 03 Nov 2015, 08:26

I'd have to agree with you and have always seen RAM storage as cache. This made sense to me because the memory space is temporary and could not be used for much more. But then this RAM disk assignment changes that. The benefits of running programs directly from RAM are enormous if you can tolerate the risk of your computer losing power. Other than that RAM disk is just like a hard drive. On the other hand I have several system monitoring tools, including the built in resource monitor supplied with Windows. There is only one occasion when more than 4GB RAM was actively being used, and that was when I ran Windows (antivirus) Defender. This program took up nearly all of the 16GB, and more astonishing than that it maxed out all eight cores of my microprocessor during the last 5 minutes of the scan. Surprisingly enough the processor temperature stayed well within limits. Then again, I have the equivalent of a desktop fan on top of my processor. LOL

It's very possible that the system monitoring programs do not pick up on all the RAM that is active or committed. That would explain why more RAM is visibly better, but nobody is explaining it exactly that way.

User avatar
Kellemora
Posts: 1801
Joined: 16 Feb 2015, 11:54

Re: RAM Disk

Post by Kellemora » 03 Nov 2015, 10:52

Way way back, in the 286 days of computing, I was using a RAM Disk program. We didn't have much memory back then, but if you ran small programs entirely in RAM, they were like lightning.
A simple game like Solitaire, if you won, you could watch the cards peel off and cascade like a waterfall.
If it was run in RAM, the entire affect lasted less than 3 seconds. As computers got faster, it was in nanoseconds.

I know I mentioned in the past, when I got a new computer it came with 4 gigs of memory. I often took 2 gigs out to build another machine cheaper, hi hi. 2 or 4 gigs never seemed to make a difference, nor was the swap file used.
But after using the SilverYogi with 16 gigs, I took the memory out of machines that died, which matched of course, and placed 8 gigs in a machine which only had 2 gigs. Before doing so, I timed many of the things I did. Afterward, there was a definite increase in speed for almost everything, not just how fast changing to a different program loaded due to the use of more cache.

Number of CPUs? Almost all of my machines were Dual-Core. I did buy one Quad-Core and it was slower than the Dual-Core, but slightly faster than a single Core ;machine of the same CPU speed rating.
In the early days of multiple CPUs, the programs did not make use of the extra cores. However, if you opened two programs, often they would use the other CPU, which kept the machine from bogging down.

You are right that a system monitor can only show us so much. One thing nice about having a dual monitor split screen is I can open the system monitor on another screen to keep it out of the way, and it shows what each CPU is doing.
On the SilverYogi, the System seems to favor CPU#1, unless it is already in use by something else. Rather than dividing processes up between the CPUs, if I am running more than one program, the most active uses CPU#2 with occasional uses of CPU#3. If I'm doing graphics work using Gimp, three of the four CPUs become active and seem to share the load.

I finally got around to copying the frau's data from an external backup to her new Windows 10 computer internal drive. The process took 3 hours 48 minutes. Using a USB 3.0 port with a USB 3.0 backup drive.
I brought the backup drive up to my office, and using a USB 2.0 port with the USB 3.0 drive, I copied the backup drive to an external 4 terrabyte drive plugged into the only USB 3.0 port my machine had. A 4 gHz AMD CPU, 2 gigs RAM, box running Debian 7. It only took 1 hour 29 minutes to complete the files transfer.
I always knew RSync did things fast, even when copying everything to a new folder. So I created a new folder on the 4 terra drive, set RSync to read from the external backup drive and copy it to the new folder on the 4 terra drive. The total elapsed time from when I hit the gear to start the process, to the time it came up and said completed with no errors was 44 minutes.

I think the main reason the Windows 10 machine was so slow is being Windows it used the Backup Drives file reading program to move the files onto her on-board drive. Where when using the Linux machines, I just copied the data folders directly from external drive to the external drives.
I have not tested a simple direct copy on her computer since when you plug the drive into a Windows computer, their backup program automatically takes over and shows you their file manager window. I found no way around this.
No biggie now that she has all her files back. She still hates Windows 10 though and wants her XP back. I told her XP won't work on the new computer, no drivers for it, hi hi...

Post Reply