Why not use SSD space as RAM?

63

26

I am new to the hardware side of things. I run a few machines which have 400GB+ SSD's and 32GB RAM. I have been thinking about going up to 64GB RAM, however, I was thinking, since SSD's are solid-state like RAM, can't my extra space be used as RAM?

If I do this, will the extra RAM (from disk space) be significantly less efficient than DDR3 RAM?

Jenny

Posted 2013-07-10T09:41:23.150

Reputation: 791

If it were that simple, wouldnt everyone be doing it? – Keltari – 2014-08-04T16:47:21.340

1I know that it's an older question but depending on your workload they can certainly be beneficial as caches for a HDD array though, less writes than trying to use it as memory but an appropriately sided SDD cache for your workload can be a significant performance benefit by avoiding unnecessary HDD accesses for frequently accessed data. It's probably not a bad idea to make the investment in a large capacity drive with high P/E cycle flash for a cache drive though. That said a 6,000 P/E * 1 TB = 6 PB my cache averages 30GB/day so at that rate old age will probably get me before the 547 years. – MttJocy – 2016-05-22T13:42:53.167

I am starting to see some new computers that are sold with DDR RAM, and very small solid-state drives for caching, and regular hard drives. They simply call it "memory" but it's not the same as RAM. – Scott M. Stolz – 2017-11-09T18:37:48.147

14Isn't that basically what "swap"/"pagefile" functions in modern OSes are doing? – user1686 – 2013-07-10T09:44:38.657

7Because SSD have limited writes, and your system makes hundreds of writes to your memory every hour, which means a SSD device would have a lifespan of a few days at that rate. Plus in terms of pure speed SSD is extremely slow compared to memory. Random Access Memory does not store the values after the power has been turned off, NAND the memory sed in SSD hardware does. NAND would make horrible Random Access Memory for a lot of reasons other then speed. – Ramhound – 2013-07-10T10:53:08.497

Answers

42

Two years after the question was posed, the answer is changing from no to maybe.

Samsung SM951 is the current state of the art and, in RAID 0, has been shown in testing to achieve 4.5GB/s read and 3GB/s write. At a cost of $1/GB per disk this is significantly cheaper than RAM.

http://www.legitreviews.com/samsung-sm951-m2-pcie-ssds-raid0-performance_161753/5

DDR4 data transfer rate:
DDR4 2133:17 GB/s
DDR4 2400:19.2 GB/s
DDR4 2666:21.3 GB/s
DDR4 3200:25.6 GB/s

http://www.transcend-info.com/Support/FAQ-292

Further, the short lifespans of SSDs have been greatly exaggerated with tests showing that the 250GB Samsung 840 Pro sustains 2.4PB of writes.

http://techreport.com/review/27909/the-ssd-endurance-experiment-theyre-all-dead/4

Depends on the application. If speed is more important than space then RAM, otherwise (maybe) look at SSD.

Andrew

Posted 2013-07-10T09:41:23.150

Reputation: 872

Prolly relevant, tho smewhat extreme. http://newsoffice.mit.edu/2015/cutting-cost-power-big-data-0710 - MIT's experimenting with a cluster that uses SSDs, and some FPGA stuff. The tech world's changed a fair bit since my original answer, tho I still think SSDs compilment not replace having enough ram for what you are doing.

– Journeyman Geek – 2015-07-13T04:45:40.440

Nice read, that last link. And also, unrelated but good to know: "Among the ones we tested, only the Intel 335 Series and first HyperX remained accessible at the end. Even those bricked themselves after a reboot." So if my SSD ever reports an error, I'm going to make sure not to reboot until I saved all recent data :-) – Arjan – 2015-09-01T22:01:59.167

I do strongly agree that "short lifespans of SSDs have been greatly exaggerated", even if you do continuous full write stress test, it should have a relatively long life, even going over a year. – sharp12345 – 2016-02-29T02:33:36.000

if the answer is changing from no to maybe, is it possible to do it?, how? – elikesprogramming – 2016-10-25T19:53:41.253

1The PCIe M.2 performances quoted are sequential transfer speed, not random read/write. So we may not be comparing apples to apples here. – Καrτhικ – 2016-11-07T16:07:31.240

This is an insightful answer. I guess when it comes down to it, if you are working on a terabyte sized dataset, but don't have US$20k to drop on a used server, and can afford the slower processing time, it might be worth using SSD's.

Having said that, if you only need it occasionally, it might be a better use of time to hire the use of a server (say aws) for a short time to do your processing. – MattJenko – 2017-07-13T06:07:28.190

"At a cost of $1/GB per disk, therefore $2/GB in RAID 0" This is inaccurate, you do not lose space in RAID 0. – TheFiddlerWins – 2018-04-24T13:14:45.843

Random read/writes and latency are more important imo – Firebug – 2018-05-20T17:20:20.340

Try to look at Intel Optane ;) 905P / P4800X – Xdg – 2018-11-09T19:50:59.957

53

Firstly, RAM is still significantly faster than both your regular 6gb/s SATA or even the newer PCI-e based solutions. RAM is also designed to be written and erased repeatedly, at the cost of volatility. RAM generally doesn't wear out due to regular use - though, of course, it can fail like any component.

While the lifespans of SSDs have gotten much better, SSDs do wear out. They're absolutely brilliant for nonvolatile use, but if you wrote and overwrote NAND (which SSDs contain) like you do RAM, it would wear out.

Both are really optimised for different things, and you're better off having enough RAM (and using SSDs or spinny hard drives for paging out) than compromising on enough RAM for the task.

Journeyman Geek

Posted 2013-07-10T09:41:23.150

Reputation: 119 122

40

As grawity suggested you already have the swap/page file performing this task. Now even a SSD is much more slower compared to DDR3. SSDs can deliver up to about 654MB/s while 1333MHz DDR3 in dual-channel mode can deliver up to 21.3GB/s (21 332MB/s).

user555

Posted 2013-07-10T09:41:23.150

Reputation: 727

But many applications don't work on the pagefile, when the RAM is full they just give an error. – skan – 2016-09-27T19:49:46.807

1@skan Nothing can be done about bad coded applications. AFAIK the paging of system memory should be transparent to the application. Broken applications my simply think that if there is no more RAM left it's time to shut the business down. – user555 – 2016-09-28T14:46:03.647

1@skan, no.. applications are not even aware they are being paged out. They only way they can tell is by the slow down, which can be caused simply by higher priority tasks hogging the cpu. – psusi – 2016-11-01T23:41:53.643

25

Yes, it will be significantly less efficient than DDR3 RAM.

  1. SSD will wear off quickly if used as RAM (frequent writes). So it will only be effective for 2 months or so, after that it will surely die. (So instead of 10 years of life ... it will live for about 10 weeks.)
  2. SSD is a disk device. CPUs can only pre-load data into its cache from RAM. If it will be on an SSD, it must be first loaded into RAM... Accessing the disk (even very-fast SSD) is around 100 times slower than accessing RAM. See benchmarks of HDD, SSD and RAMDISK (ramdisks on DDR3 have more than 3000 MB / sec , and less than 0.1 milisecond wait time for access. So, clearly: SSD cannot compete with speed of RAM).

Filip OvertoneSinger Rydlo

Posted 2013-07-10T09:41:23.150

Reputation: 351

20

The key reason why you can not use an SSD as ram is because it is connected to the computer as if it were a disk drive, rather than ram. That is to say, that the processor can not directly address the memory in the SSD but instead has to hand a block of ram to the SATA controller and ask it to transfer data between that ram and an area in the drive.

The new NVM Express interface is poised to change this. It allows the CPU to map swaths of the SSD directly into its memory space and use it like RAM instead of issuing IO requests to transfer between RAM and the SSD. This has the potential significantly speed up access to the SSD while using less RAM as it is no longer required to cache the data while the CPU accesses it. This is currently an area of active development in the linux kernel.

psusi

Posted 2013-07-10T09:41:23.150

Reputation: 7 195

4The first paragraph is basically the correct answer to the immediate question. Speed and wear on drive mentioned by others are secondary issues - even if SSDs were just as fast and resilient as RAM, currently we still could not use it as RAM. – mtone – 2015-04-12T16:53:52.290

Anyone in the know-how in this area be able to update the answer? For example, are Samsung's m.2 960 Pros fast enough with good enough heat dissipation to manage the job? – n1k31t4 – 2016-10-31T20:02:35.693

@DexterMorgan, heat dissipation isn't really a thing, and whether it is fast enough is a judgment call. – psusi – 2016-11-01T23:31:02.923

0

I have a laptop with maximum RAM of 4GB installed. I thought that using SSD for swap space would speed up my system. I have 250 GB Samsung drive, and allocated 32 GB for swap space. My PC runs much slower! I'm running Windows 10 Pro 1709 on a Lenovo 3000 N200 laptop. I have recently read that Microsoft recommends minimum of 8 GB RAM for Windows 10. I now have an 8 GB laptop, and its performance is much, much better.

rhmccullough

Posted 2013-07-10T09:41:23.150

Reputation: 381

correction: my speed results are invalid. I made the mistake of changing the virtual memory settings in Control Panel, instead of just clicking the ReadyBoost button in File Explorer. – rhmccullough – 2017-12-01T15:28:04.977

1This is not a valid test! – TheFiddlerWins – 2018-04-24T13:17:18.197

1Ok Fiddler -- you win. – Murdoch Ripper – 2018-06-22T06:47:23.793