Should I worry about resource limits for flash write cycles?

I am writing an Android application that writes data to a file several times per second, the total file size is about 1 MB, after which this file is erased and a new file is launched. Do I have to worry about wearing out the phone’s flash memory, which makes it fail? Did you know that Android distributes records across sectors to minimize flash degradation, even if the application writes a continuous file? Does the logging system work in a similar way? In other words, if I register a lot (a few entries per second), will this affect the phone’s flash memory resource?

+4
source share
2 answers

It would not hurt to worry about this, but in addition to the cycles of writing flash memory, I would also process the application logic - 1 MB is not so much, so buffering the data in memory and periodically (and less often) deleting them in a file is your application (as I assume that your posts are synchronous).

EDIT

The wiki got some numbers to consider:

Stamina Writing

The recording duration of an SLC floating-point NOR flash is usually equal to or longer than a NAND flash, while MLC NOR and NAND flash have similar endurance capabilities. Examples of endurance cycle ratings listed in the data tables for NAND and NOR outbreaks.

  • SLC NAND flash is usually designed for about 100 thousand cycles (Samsung OneNAND KFW4G16Q2M).
  • MLC NAND flash memory was rated at about 5k - 10k cycles (Samsung K9G8G08U0M), but now it usually amounts to 1k - 3k cycles.
  • The TLC NAND flash is typically rated for approximately 1k cycles (Samsung 840).
  • The SLC floating point NOR flash has a typical endurance of 100 kHz to 1M cycles (Numonyx M58BW 100k; Spansion S29CD016J 1,000k) The MLC floating point NOR flash has a typical endurance rating of 100k cycles (Numonyx J3 flash)
+4
source

It depends on the type of memory and file system. NAND flash memory provides more write cycles than NOR memory. In addition, file systems such as JFFS2 provide a wear leveling algorithm to distribute data and prevent block damage.

Comparison of NAND and NOR flash technologies: https://focus.ti.com/pdfs/omap/diskonchipvsnor.pdf

+1
source

Source: https://habr.com/ru/post/1443235/


All Articles