Wikipedia:Reference desk/Archives/Computing/2018 December 25

= December 25 =

Memory question
There are 400GB MicroSD cards for US$45 (US$0.11/GB) but I'm hard-pressed to get more than 32GB in my desktop, and it cost of about US$5/GB. Now, I realize that the memory in a desktop is much faster than that in a MicroSD card, but why is there such a large disparity in the technology? Bubba73 You talkin' to me? 00:06, 25 December 2018 (UTC)


 * You could get RAM as cheap as flash if you were willing to buy RAM that


 * Is really slow
 * Won't let you read and write a memory location, instead forcing you to erase and rewrite a much larger chunk of memory.
 * Has up to 10% of the memory locations bad.


 * That's right, every SD card without exception is riddled with defects.


 * You are presented with the illusion of an error-free storage through sophisticated error correction and bad block management.


 * Every SD card contains a microcontroller (usually an ARM Cortex nowdays) to hide the errors from you. When you try to access a bad part of the card, it maps in a good part.


 * It is possible -- if you know the secret -- to replace the program that the microcontroller runs. I know how to do it on the specific SD cards that I have done engineering work on, but of course I have signed an NDA and cannot tell you how to do it.


 * Alas, there are people in China who also know how to replace the program that the microcontroller runs, and they put in a modification that causes the SD card to report the capacity of the card as being larger than the actual storage. They then change the markings and sell it at the higher price. You buy a counterfeit 64GB card that is actually an 8GB card, and you don't find out until you try to write past 8GB and find that it erases some of the first 8GB you stored to make room for your data. There is a good program for detecting fakes at [ http://oss.digirati.com.br/f3/ ]. --Guy Macon (talk) 01:34, 25 December 2018 (UTC)


 * Yes, I've heard of the card with the fake size. But my main question is not about the price, but about the capacity and speed. I have a lot of DDR3 8GB sticks.  They have eight chips so each chip is 1GB.  Why can't they put chips with much higher capacity on DDR3 sticks?  Bubba73 You talkin' to me? 02:03, 25 December 2018 (UTC)


 * RAM stick design is complicated, and I don't pretend to completely understand it, but there is a limit to how many chips you can have on a stick before you start to have issues. If you need lots of RAM like in a server, you use Registered memory which allows more chips to be used. (Don't confuse this with ECC memory.) Although again as said it's complicated, R-DIMMs could easily have less chips than U-DIMMs of equivalent capacity. (But for example, ECC is just a small contributor to the number of chips on this stick [//www.newegg.com/global/nz-en/Product/Product.aspx?Item=N82E16820148803].) However I don't entirely understand the relevance of this later question to your earlier ones. While SSDs tend to have multiple chips, they don't tend to have more chips than is common on RAM sticks except perhaps at the real high end. MicroSDs of course only tend to have a single NAND chip, 3D stacked or not. If you want to know why NAND chips are so much higher capacity than DRAM chips, that's a separate issue from your follow up question, but I'd suggest the first question to ask yourself is why you expect their capacities to be similar. Nil Einne (talk) 16:17, 25 December 2018 (UTC)


 * I guess I'm not understanding all of the aspects of the difference in the technology. The largest chips I know of on DDR3 are 2GB and there are SD card chips 256GB and higher.  I know DRAM is faster and volatile whereas the other is slow and non-volatile.  Is there a lot more circuitry that goes with the DRAM chips that limits their capacity to a tiny fraction of the NAND chips?  Bubba73 You talkin' to me? 19:15, 25 December 2018 (UTC)


 * There isn't a simple answer to your questions. I'm not an expert on semiconductor memory, so speaking very generally:
 * Flash memory cells are simpler than DRAM cells in component count. A flash memory cell contains one floating-gate transistor; a DRAM cell, a n-channel MOSFET and a capacitor. This is misleading to a degree, because the floating-gate transistor in real flash memories is a more complex structure than what the ideal structure suggests, and it's more complex than the transistor in DRAM cells. However, the modern DRAM cell's relatively simple transistor is offset by the complex structure of its capacitor, which is contorted to hide its volume in between the wires above the transistor (but sometimes [or most of the time?] this cannot be done, and the the capacitor adds to the cell's area). These complexities arise out of the inability of fabrication technology to produce ideal structures.
 * NAND flash memory uses multi-level cells (MLCs) that store n bits as 2n threshold voltages. The memory cells in commercial DRAMs is only capable of storing one bit, as a discharged or charged capacitor. (Experimental DRAMs have explored multi-level cells, but such DRAMs have never been commercialized, AFAIK).
 * Cells in NAND flash memory can be connected in a dense bit line structure more easily than cells in DRAM for a number of reasons. One of these reasons is because DRAM bit line structures have to find some balance between density and noise immunity. Real DRAMs must design in a manner that ensures proper and reliable operation in the intended environment. This is due to the way these memories operate: flash memory senses threshold voltages, DRAM senses minute changes in bit line voltage by turning on the transistor to connect the storage capacitor to the bit line.
 * Flash memory cells in NAND flash memories are physically laid out as an array of columns perpendicular to the die surface, with each column containing multiple cells. In modern NAND flash memories, it's between 48 and 96. NAND flash memories expected in the next few years are expected to raise the count to 128 or more. In modern commodity DRAMs, the cell is a three-dimensional structure that extends above the die surface, but the array is two-dimensional, AFAIK. This is not to be confused with stacking multiple ICs onto each other within a package.
 * These points only hint at the differences and the finer points of memory design that effects the density and cost of flash memory and DRAM ICs. Your question asked why there's a difference in density and cost of module-level hardware, which is much more difficult to answer. 99Electrons (talk) 04:49, 27 December 2018 (UTC)
 * Thanks, there is a lot more to it than a layman would suspect. I imagine that with the bad bits and bits going bad, it also has to keep track of them.  Bubba73 You talkin' to me? 18:31, 27 December 2018 (UTC)


 * There is a confusion here. If want to expand your RAM then any flash based memory is unsuitable for this purpose. It is too slow. Or if (as it is more likely) you just want to expand your storage i.e. to use a memory card as SSD then again they are unsuitable for this purpose. They are too slow and flash memory that is put in them is of a low quality and has only a low endurance as compared to SSD. In addition their controllers are much simpler that those in SSD. Ruslik_ Zero 20:58, 25 December 2018 (UTC)


 * I know that flash memory is too slow, but there must be a technical reason why flash memory is so much cheaper and has higher capacity than RAM chips. Flash memory costs about 100x as much as DDR4 per GB.  And the flash memory chips hold something like 128x more than a DRAM chip.  Why?  Bubba73 You talkin' to me? 00:38, 26 December 2018 (UTC)


 * I already gave you the technical reason why flash memory is so much cheaper and has higher capacity than RAM chips. As I explained above, you can make far denser chips if you are willing to tolerate [A] A huge number of bad memory locations, and [B] more and more locations going bad as time goes by. RAM requires 100% good memory that stays good. SD cards can tolerate one bit out of ten being bad and you will never know the error happened. There are other differences, but that's the main one that makes SD cards larger and cheaper. --Guy Macon (talk) 03:15, 26 December 2018 (UTC)
 * Thanks, I guess I didn't understand it the first time. Bubba73 You talkin' to me? 07:34, 26 December 2018 (UTC)
 * Basically if you have 8 GB = 64 Gbit DIMM and only one of these 64 billions bits fails then you can just throw the DIMM away. Ruslik_ Zero 20:38, 26 December 2018 (UTC)
 * Yup. And if you have a defect rate of one bad bit per billion bits, you can spend all day making chips without lucking out and getting a single good one. Meanwhile the SD card production line next door is happy as a clam if there is one bad bit per each thousand bits and the chip develops a new bad bit once every week -- all of which is completely invisible to the user. --Guy Macon (talk) 20:51, 26 December 2018 (UTC)

Thanks, I understand better now.

A related question: back in the 1980s you could get a memory card that went into a slot. Is there such a thing for PCI slots now? It could be several times slower than main RAM, but have to be much faster than an SSD or flash card and look like regular RAM to the computer. It would have a capacity of 512GB or 1TB, and not cost a fortune? (I've searched and not found anything like that.) Bubba73 You talkin' to me? 21:40, 26 December 2018 (UTC)


 * It's been suggested that products based on Intel and Micron's 3D XPoint could have a role as something in between RAM and regular storage although they have only had success in niche markets and I don't believe anyone seriously suggests they should appear as normal RAM. Instead the OS and preferably application should understand what they are and treat them accordingly. Modern OSes are sophisticated and there's no reason why they have to be so dumb. It's also unclear if PCI Express (which I assume is what you mean by PCI) is the best bus for that [//arstechnica.com/gadgets/2018/05/intel-finally-announces-ddr4-memory-made-from-persistent-3d-xpoint/].Nil Einne (talk) 10:40, 27 December 2018 (UTC)
 * A reasonably fast SSD may be the way to go for now. The program I'm working on has two phases - generating data and then organizing it.  When I went to bed last night it was on the second phase and the memory use was OK.  When I woke up it was swapping to HD, and this went on for hours.  Now I've changed the virtual memory to an old 512GB SSD.  But perhaps a faster SSD, either for vitrual memory or maybe I can rewrite the program to use the SSD directly.  Bubba73 You talkin' to me? 20:33, 27 December 2018 (UTC)


 * Yes, there exist DRAM based SSDs but they are very expansive. Ruslik_ Zero 18:04, 27 December 2018 (UTC)