4

In my chat app, I am adding the ability to log chats. The logs are saved on the sdcard and one BufferedWriter is kept open for every person/channel chat is done with. I'm wondering what effects this might have have on the sdcard and its life.

My BufferedWriter's buffer size is to 1024, I'm also wondering if that is too small or too big.

Al.
  • 2,285
  • 2
  • 22
  • 30
  • Why don't you ask the OS what the filesystem block size is, then set `BufferedWriter` to equal it? This will guarantee the least writes, doesn't it? – William C Feb 04 '12 at 06:30

1 Answers1

3

Flash memory cards have an endurance of about a million write cycles per area and probably include wear levelling which basically means trying to write to different areas so specific spots dont wear out.

So after about (sizeOfSDCard/sizeOfYourData)*1,000,000 writes, you will have ruined their card.

Practically, this means you probably aren't going to cause any harm.

jqpubliq
  • 11,874
  • 2
  • 34
  • 26