3

I have been taught in Memory hierarchy we have RAM to get rid of bottleneck of HDD as they are very slow being a mechanical devices. Since CPU are very fast and to maximize their use we have RAM (Then cache).

Now instead of HDD we use SSD which are electronic devices that work much like RAM as explained in this article.

My question is if SSD are like RAM then why isn't RAM replaced with SSD ? I can see the benefits of no overhead of memory techniques used to communicate between RAM and SSD. Also CPU can directly communicate with SSD without overhead of first accessing RAM

Ahtisham Chishti
  • 151
  • 2
  • 2
  • 10
  • 2
    RAM is more resilient to long term use. SSDs nature or writing and removing data is inherently something that will wear down SSDs. So until SSDs become more resilient to use, RAM that holds data until powered off is here to stay. – Giacomo1968 Jan 23 '22 at 05:27
  • 2
    "Now instead of HDD we use SSD which are electronic devices that work much like RAM as explained in this article." – Your question is based on a wrong assumption. Flash is significantly slower than DRAM, both in terms of latency and in terms of throughput. SSDs are very much *unlike* RAM. – Jörg W Mittag Jan 23 '22 at 12:33
  • 2
    Im really surprised this was closed as opinion based. There are solid, objective reasons why ssd can be used as RAM. – davidgo Jan 23 '22 at 19:07
  • Agree, this shouldn't have been closed, especially with two good answers. – user10489 Jan 23 '22 at 20:57
  • @AhtishamChishti - You shouldn't assume bad intentions from the community. If the quality of this question was improved I would vote to reopen it, as I agree, it can be answered. There are solutions that already exists that use a modified version of your idea. – Ramhound Jan 24 '22 at 01:29
  • *"Also CPU can directly communicate with SSD without overhead of first accessing RAM"* -- Please provide proof that this is possible. Unless there's a revolutionary computer and/or new drive interface that's out there, this is false. Where would the computer put an LBA's worth of data other than in memory (RAM) after a read operation? – sawdust Jan 24 '22 at 04:04
  • 1
    The question seems to be based on the superficial premise that RAM and SSD both can "store" data, i.e. *"SSD are like RAM"*. Answers based on performance differences are bogus. A mass-storage block device is simply incompatible as a substitute for RAM as main memory. You need RAM to buffer the block/sector between the CPU and the mass storage device. See https://superuser.com/questions/1253125/ssd-vs-ram-whats-the-cost-durability-difference-and-limitation-to-using-ssd-as/1253168#1253168 – sawdust Jan 24 '22 at 04:09
  • While I do agree that most SSDs are block devices and can't be treated as ram, it appears that Optane is an exception, so you are slightly wrong here. Optane is 10x slower than ram and fits in a ram slot. It does look like ram. Things will get more confusing when mram (which is on the market now) and similar new nvram becomes feasible. – user10489 Jan 24 '22 at 05:08
  • 1
    And just because a question has false premises isn't a good reason to close it as "opinion-based". There are good hard facts to be had here, and if the questioner knew the correct answer, there would be no need to ask the question. I think this was closed incorrectly. – user10489 Jan 24 '22 at 05:10
  • @user10489 -- The question specifies SSD, and not an alternate technology to replace non-volatile DRAM (Dynamic RAM) such as Optane, which is a new type of RAM. If Optane is used in a SSD, then it's now a block device and no longer suitable for use as RAM. Don't conflate a RAM technology with types of devices. So Optane is not the the exception you think it is. – sawdust Jan 24 '22 at 06:25
  • 1
    @sawdust This is not a discussion forum. I don't see any point in discussing this here. If you want to continue, either reopen the question or ask a new one. This may be a duplicate question, but it was not closed that way, it was incorrectly closed as opinion based. – user10489 Jan 24 '22 at 06:37
  • @user10489 *"I think this was closed incorrectly"* -- It's a duplicate. See my comment: https://superuser.com/questions/1253125/ssd-vs-ram-whats-the-cost-durability-difference-and-limitation-to-using-ssd-as#comment1841253_1253125 – sawdust Jan 24 '22 at 06:37
  • 1
    @user10489 TIL... It appears we are both right. I was talking abouth the standard Optane product I new of which were SSD. https://www.intel.com/content/www/us/en/support/articles/000056583/memory-and-storage/intel-optane-memory.html - also look at the specs and note the "4k blocks" https://ark.intel.com/content/www/us/en/ark/products/123623/intel-optane-ssd-900p-series-280gb-2-5in-pcie-x4-20nm-3d-xpoint.html - It appears that there is also Optane PMEM which Id not heard of, which does indeed offer byte addressable access. – davidgo Jan 24 '22 at 06:42

2 Answers2

6

SSD is not like RAM. There are a couple of very important differences -

  • SSD's have a limited number of writes, and really need to be written in blocks. There is a whole lot of abstraction to provide more writes by hiding blocks as they go bad. (Thats what TRIM is all about for a start). If SSD was used like RAM it would die very quickly.
  • While SSD's have a much lower latency and higher speed then hard drives, they are still much, much slower then RAM.
  • Most SSDs are not random access, but block structured, like disks. You can't read or write one byte, you have to use a whole block.

As @PathToLife indicated, it is quite practical to use high speed SSD as a cache to extend RAM. Until they discontinued it, Intel offered something called "Optane Memory" which was, in effect, a high speed SSD used as cache.

Related to your query - back in 2014 HP was working on what was going to be a revolutionary new a system which used non-volatile memory as RAM. Google "HP The Machine". They were looking at using a novel technology called memristors, but it didn't pan out for them.

user10489
  • 1,173
  • 1
  • 5
  • 10
davidgo
  • 68,623
  • 13
  • 106
  • 163
5

TLDR;

SSDs still aren't as Performant as RAM for the Insane Data manipulation speed of today's CPUs.

It would be possible to use SSD as RAM - for a potato PC or mobile devices - with a few architecture changes regarding security as there's no more volatile storage. As @user10489 pointed out, SSD as RAM is quite limited in practicality, and not possible currently for modern day computers (as of 2022) - would have to be a custom architecture.

There has been research into non-volatile-random-access memory, but any meaningful impact may be 5-15+ years away.

Fun fact: We do move stuff out of RAM onto the SSD if the RAM is too full, it's called PageFiles! MacOS and Windows have been doing this for years. But accessing the SSD pagefile is still not as good as RAM.

RAM requires in particular

  • Super Low Latency
  • Insane amounts of writes / rewrites / read (More than what SSD flash can handle)
  • High Average Bandwidth (Data transfer speed) 51.2 GBs DDR5 vs 7GBs NVME SSD
  • Low Random Data Access Latency (Data operation speed) IOPS..
  • Consistently in performance (SSD has operations that may drop performance. e.g TRIM)
PathToLife
  • 1,146
  • 9
  • 18
  • *"It would be possible to use SSD as RAM - for a potato PC or mobile devices ..."* -- A bogus claim unless you can cite a reputable/credible source. *"But accessing the SSD pagefile is still not as good as RAM."* -- You seem to misunderstand how virtual memory works. The RAM and backing store are both required. – sawdust Jan 24 '22 at 04:36
  • 1
    I think today's SSDs are probably more than fast enough to pretend to be ram for, say, a 1khz computer from the 80's. While that's a bit of a stretch, there's probably something in between where it actually makes sense. I think this claim can't be thrown out so easily. Yes, SSDs are typically block structured, but the real difference between SSD and ram is actually speed. (And density -- but ssd's win there.) Same reason SSDs haven't totally replaced disks -- they might win on speed there, but spinning disks still have higher density and will for probably another decade. – user10489 Jan 24 '22 at 05:16
  • https://ieeexplore.ieee.org/document/8948343 – PathToLife Jan 24 '22 at 05:31
  • Non-volatile-random-access memory is not something new. Ferrite core memory is non-volatile RAM. That IEEE article refers to *semiconductor* NVRAM. FYI such *semiconductor* NVRAM is not related to SSD, which is a block device. – sawdust Jan 24 '22 at 06:14
  • The answer attempts to give the student a simplified explanation of physical limitations of non-volitile-cells; which computer scientists / material scientists needed to account for. Regarding your statement "You seem to misunderstand how virtual memory works"; you may have more knowledge about machine level operations (address translation etc), but please consider more rudimentary answers for the student. – PathToLife Jun 27 '22 at 09:15