why does flash memory have such a limited life?

hahher

Senior member
Jan 23, 2004
295
0
0
i used to have impression that non-mechanical storage would be a lot more reliable than regular hdd. reliable like other chips (i.e. cpu's) are reliable for a very long time. but flash memory can only be rewritten 1000's of times. why?
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
Flash memory stores information within a 'floating gate' circuit. The floating gate is insulated from the rest of the circuit so electricity cannot flow in or out, which allows it to store data for long periods of time.

See how stuff works for a reasonable description of how the process works.

In order to write information a process called Fowler-Nordheim tunneling is used: when electrons are exposed to a high voltage, they actually 'tunnel' through the insulation and accumulate on the floating gate. The problem is that FN tunneling is destructive - everytime electrons tunnel across the insulation layer, they damage it. Eventually, the insulation is damaged to the point that the memory cell cannot store data reliably.

Modern flash memory is rated for a minimum of 10,000 erase/writes. It is possible to get 'high-endurance' flash chips which can be rewritten between 100,000 and 1,000,000 times.

Some flash memory cards (Compactflash in particular) uses a technique called 'wear levelling'. An internal computer arranges for data to be saved into the freshest part of the flash every time, instead of just overwriting old or erased data. This maximizes the life of the memory.
 

Mday

Lifer
Oct 14, 1999
18,647
1
81
i'll add one thing to mark's post.

The destruction happens when a 1 is erased, that is, when 1 becomes 0. This is not to say that you can go from 0 to 1 without causing wear.

analogy time =D
when you write on a piece of paper with a pencil (not too hard), you put graphite on it. If you erase it, you wind up damaging the paper. so, if you write again, erasing it would damage the paper even more. there are erasers that do less damage to the paper than some (white "polymer" kind vs pink hard kind). eventually all this writing and erasing will put a hole in the paper, thus making that area useless.
 

grrl

Diamond Member
Jun 21, 2001
6,204
1
0
So does this mean as the memory gets older you will have more and more errors. i.e. corrupted data?
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
Originally posted by: grrl
So does this mean as the memory gets older you will have more and more errors. i.e. corrupted data?

Yes, but if you use flash memory the way it's meant to be used, you won't wear it out.

Even if the card doesn't use wear levelling, and has a relatively short life of 10,000 erase cycles, then in a digicam that'll be about 10,000 photos - or an mp3 player 10,000 file uploads. That's not an unreasonable amount. With wear levelling it could be much more. In fact it's not as bad as that, even. Many premium brands of flash memory now guarantee 100,000 erase/write cycles - some, as many as 300,000.

Of course, if you do something like put your swap file or internet browser cache on a flash drive, or run regular defrags then you will kill it much more quickly.

All readily available flash memories use ECC internally. This allows corruption to be detected and corrected within the chip. Some more sophisticated cards will automatically move corrupted (but recoverable) data to a spare sector and mark the original as bad. Many will also verify the data after every write and, if the write fails, try another sector. This means that a few 'weak' sectors won't leave the whole memory unusable.

Unless you use a flash drive for a system where data is changed continually on a minute by minute basis you are unlikely to wear it out within a reasonable period of time. If not damaged mechanically, you could probably expect to write to a flash drive about 1 million times before you run into problems.
 

jhu

Lifer
Oct 10, 1999
11,918
9
81
do other types of flash memory (eg sd, smartmedia) have wear levelling?
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
SD, like MMC and CF have internal CPUs which perform all the necessary house-keeping including wear leveling. This is all done automatically and invisibly.

Smartmedia cards are just a flash memory chip inside a fancy package. The internal flash chip essentially does nothing apart from store the data. It's up to the card reader/writer to wear level the card. SM cards use a special format called SSFDC which has wear leveling and ECC built in.

The main difference is that CF, MMC and SD have an internal CPU which deals with the limitations of the flash and makes it appear as a disk to the system.

SM needs a controller in the reader: on PC based systems this controller also does translation, making it look as if the card is formatted in FAT.
 

Mday

Lifer
Oct 14, 1999
18,647
1
81
this is also why i rotate cards, and keep old pictures in cards for as long as i do. the first gen was 1000 times, and that meant with heavy usage, a card could last maybe a year tops. but now, it really is in the tens-hundreds of thousands and millions.