slow Storage Card

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a weird problem. Saving to my Compact Flash card to a specific
directory on the card (/Storage Card/images) became very slow. Any size file
took about 4 seconds to save to it. If i saved to ANY other directory it was
fast (less than 0.2 seconds).

The problem started after I had over 100 megs worth of images in that
specific directory (/Storage Card/images). I expect that it will go slow with
that many images in it, but once the images were all deleted, it continued to
go slow, even after rebooting. The only way to solve the problem was to
delete the directory (/Storage Card/images) and then recreate the directory
again, then the save speed was normal again.

Since this directory will be filled and un-filled on a regular basis by the
customer, i need to stop the save speed from slowing down. Does anyone have
any idea how to solve this problem? Or any idea what could have caused this
to happen?
 
For a directory, the question is not so much the size of the files, but the
number of them. How many were there?
 
I have a weird problem. Saving to my Compact Flash card to a specific
directory on the card (/Storage Card/images) became very slow. Any size file
took about 4 seconds to save to it. If i saved to ANY other directory it was
fast (less than 0.2 seconds).

The problem started after I had over 100 megs worth of images in that
specific directory (/Storage Card/images). I expect that it will go slow with
that many images in it, but once the images were all deleted, it continued to
go slow, even after rebooting. The only way to solve the problem was to
delete the directory (/Storage Card/images) and then recreate the directory
again, then the save speed was normal again.

Since this directory will be filled and un-filled on a regular basis by the
customer, i need to stop the save speed from slowing down. Does anyone have
any idea how to solve this problem? Or any idea what could have caused this
to happen?

The FAT directory can hold only a limited amount of file entries until it
starts growing past single cluster. When you delete a file in the FAT
directory, you do not shrink the cluster chain, so unless you deleted and
recreated the directory, it will continue to occupy more than one cluster,
degrading performance. To resolve this programmatically, create a new
directory, move all the files to it and delete the old one, then rename the
new directory.
 
There was about 2000 files in the directory at one point. All the files were
deleted and it would still save very slow. I don't understand how this can
happen.
 
Thanks for the Info, I did not know that.
Do you know exactly how many file entries in a directory cause the FAT to
grow past single cluster?
 
Back
Top