-->
Page 1 of 1

SPIFFS minimum file size

PostPosted: Sat Sep 24, 2016 6:56 am
by diffstorm
Hi All,

I'm using es8266 arduino with spiffs (FS.h) (1M Flash with 256K SPIFFS) and I noticed that every file allocates 502 bytes memory even if the file is 8 bytes long.
I have 8 bytes long files but every single file covers 502 bytes.

How to reduce that offset or configure for the best?

2 files -> "usedBytes":"1004"
4 files -> "usedBytes":"2008"
6 files -> "usedBytes":"3012"
8 files -> "usedBytes":"4016"
10 files->"usedBytes":"5020"



The "usedBytes" comes from;
Code: Select allFSInfo fs_info;
SPIFFS.info(fs_info);



The other parameters of FSInfo with 10 files in FS is like below:
Code: Select all{"totalBytes":"233681","usedBytes":"5020","blockSize":"4096","pageSize":"256","maxOpenFiles":"5","maxPathLength":"32","FreeSketchSpace":"458752"}

Re: SPIFFS minimum file size

PostPosted: Mon Oct 24, 2016 4:22 pm
by mrburnette
All common file systems have a default minimum: Linux, DOS, Windows, etc. work the same way... Windows typically use a 4K size as the NTFS minimum.

There is a concept of "sparse" storage but it too has large overhead when compared to the microcontroller world.

Ray