cache buffer SRAM DRAM

They are all memory - devices that remember information. They are really more descriptive terms, and there’s a lot of overlap between them.

Main memory - memory that makes up most of the memory capacity of the hardware. In conventional usage we only count RAM (see below), not disk/SSD.

Buffer - memory used to temporarily hold data between a data producer and a data consumer, so that neither needs to wait for the other (unless the buffer is full). For example, a disk drive may produce data in short bursts of 4KB sectors, while the CPU waiting for the data may want bigger chunks to process at once, so it won’t have to switch between tasks too often (which has a performance penalty). In this case, they may have say a 4MB buffer , so that the CPU can process in 4MB chunks (or maybe 2MB, so the buffer never gets full).

Cache memory - memory can be cheap or it can be fast, but not both. Some very clever people a long time ago showed that for most workloads, you can mix a little bit of fast memory, and a lot of cheap memory, and the system will end up performing almost as if it has a lot of fast memory. How? By storing commonly-used data in the fast memory, while gradually retiring unused data back to cheap memory (if the space is needed for other data). This is usually automatically managed by the CPU (because cache usually lives on the CPU die - for even better performance).

RAM - random-access memory. Random-access means you can quickly read from and write to any part of the memory, and it takes the same amount of time no matter where you are reading from. An example of type of memory that’s not random-access is tape. To get to data that is in the middle of the tape while you are at the beginning requires a lot of spinning and a lot of waiting. This kind of memory is called SAM (sequential-access memory). If you are reading a lot of data sequentially, RAM may not be faster and may be even slower than SAM. For example, older USB flash drives can only do 10–20MB/s sustained, while hard drives can do 100+MB/s. However, the flash drives can give you an answer much faster if you want to read one byte from a random location (the hard drive would have to run the motor to seek to the position first).

DRAM - dynamic random-access memory. While terms above were all conceptual, this one is more about implementation. DRAM is a type of RAM that is made out of capacitors. Each capacitor stores a bit, and it has a huge matrix of switches to route the correct data to the correct capacitors for either read or write. It’s reasonably fast (close to 100GB/s on modern computers) and reasonably cheap, so most computers use it as main memory.

SRAM - static random-access memory. This is memory made out of transistors reinforcing each other. The base technology is something called a flip-flop(bistable multivibrator). They are extremely fast, but expensive because they take up a lot of silicon space. Most modern computers use this for cache as part of the CPU, but on embedded systems with very little memory, you’ll sometimes see it used as main memory. Modern PC CPUs have multiple layers of cache, and the fastest one (level 1 cache) can often do 500+GB/s.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值