Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I be concerned with flash memory write cycles resource limits?

I am writing an Android application which writes data to a file several times a second, the overall file size is around 1MB, after that file gets erased and new file started. Should I be concerned about wearing out the phone's flash memory, causing it to fail? Do you know if Android distributes writes onto different sectors to minimize flash memory degradation, even when the application writes a continuous file? Does the logging system worked in a similar way? In other words if I log a lot (several records per second), will that affect the phone's flash memory resource?

like image 898
Ma99uS Avatar asked Oct 31 '12 13:10

Ma99uS


2 Answers

Would not hurt to worry about that, but aside from flash write cycles, I'd rework app logic - 1MB is not that much, so buffering data in memory and flushing it to the file periodically (but less frequently) should speed your app (as I assume your writes are synchronous).

EDIT

Wiki got some figures for consideration:

Write endurance

The write endurance of SLC floating-gate NOR flash is typically equal to or greater than that of NAND flash, while MLC NOR and NAND flash have similar endurance capabilities. Example Endurance cycle ratings listed in datasheets for NAND and NOR flash are provided.

  • SLC NAND flash is typically rated at about 100k cycles (Samsung OneNAND KFW4G16Q2M)
  • MLC NAND flash used to be rated at about 5k – 10k cycles (Samsung K9G8G08U0M) but is now typically 1k – 3k cycles
  • TLC NAND flash is typically rated at about 1k cycles (Samsung 840)
  • SLC floating-gate NOR flash has typical endurance rating of 100k to 1M cycles (Numonyx M58BW 100k; Spansion S29CD016J 1,000k) MLC floating-gate NOR flash has typical endurance rating of 100k cycles (Numonyx J3 flash)
like image 140
Marcin Orlowski Avatar answered Oct 03 '22 14:10

Marcin Orlowski


It depends on the memory type and file system. NAND flash memories provide higher number of write cycles compared to NOR memories. Also, file systems such as JFFS2 provide a wear leveling algorithm to distribute the data and avoid block damage.

A comparison of NAND and NOR flash techs: https://focus.ti.com/pdfs/omap/diskonchipvsnor.pdf

like image 38
Behnam Dezfouli Avatar answered Oct 03 '22 13:10

Behnam Dezfouli