3 ms·
The problem with flash memory is that it has a finite number of write cycles, typically around 100,000 though there are techniques that extend that. This is al
by guelo 17y ago
The problem with flash memory is that it has a finite number of write cycles, typically around 100,000 though there are techniques that extend that. This is also why the iPhone doesn't utilize a swap file.
- sp332 17y agoModern MLC cells get 1,000-10,000 writes per cell. That's about 1,000,000 writes per drive, with wear leveling.
- gte910h 17y agoYou can't get very good wear leveling with a device that's on for days at a time. Flash as a swap drive is still problematic.
- barrkel 17y agoAssume a constant rate of swapping of 128KB/sec evenly distributed across 16GB of storage space. How long before the whole system collapses, as a function of n write cycles? 16 * 1024 * 1024 / 128 * n = 131,072n seconds ~= 1.52n days ~= 0.0042n years So constantly swapping (which is a very pessimistic scenario for a phone, which spends most of its life idle in your pocket) may expect a lifetime between 4.2 and 42 years, presuming between 1,000 and 10,000 write cycles. I would say it's acceptable.
- ryanpetrich 17y agoExcept the iPhone (and related devices) don't have wear levelling. Even if they did, there's edge cases where the user fills 95% of the disk and the OS has to page with the remaining 5% (this would require a very intelligent wear levelling algorithm that could optimistically move in-use blocks)
- gte910h 17y agoAnd every wear leveling scheme I've ever seen on a battery powered device happened on bootup. The phone would be restarting all the time, or they'd be doing some sort of weird copy everything background task while the phone was running (and things would get really complicated if you tried to sync in the middle of that).
- ryanpetrich 17y agoWow, that sounds more horrible than I was imagining.