6 years, 2 months ago.

LittleFS External Memory Overhead

Hi,

I'm considering using the new LittleFS filesystem to manage data caching in external flash. I'm wondering what kind of memory overhead there is for files stored on the external flash. I would like to be able to predict how many datapoints I can cache using this file system. Is the memory overhead decreased by using one large file or many little files, or does it not matter?

My main concern (and motivation to use the library) is for the flash wear leveling feature.

1 Answer

6 years, 2 months ago.

Hi George,

I'm going to assume you're talking about the storage overhead on the external flash chip.

At the moment, LittleFS uses a full block (erase unit) for each individual file. This is usually 4KiB for external NOR flash, and much higher for NAND flash.

You're absolutely right that combining smaller datapoints into large files help reduce this storage overhead. For large files there's an average of 8 bytes of overhead per block.

I'm working on improving this area of LittleFS, but at the moment LittleFS doesn't perform well for small files.

Let me know if that didn't answer your question.