Slow Disk Read and Write When Disk Space is Low (Compact 7)
3/12/2014
This topic describes how to troubleshoot problems that occur when you have very little free space on a system disk.
Problem
On ExFAT, TexFAT, and TFAT file systems, when the amount of free disk space is low on a Windows Embedded Compact powered device, disk reads and disk writes may take much longer than expected.
Solution
Disk fragmentation combined with very low amounts of free space (less than 10 percent of the available disk space) can cause FatEx::GetFreeClusters to take a long time to find free clusters to write to. You can relieve this problem in one of three ways:
- Increase the cluster size.
- Decrease the partition size.
- Avoid small file writes and deletes.
All of these solutions create trade-offs between performance and efficient use of space.
Increase the Cluster Size
Increasing the size of clusters reduces the number of clusters that FatEx::GetFreeClusters has to search through to find free clusters. However, doing this also increases the amount of space wasted by small files. For more information, see FormatVolume or FormatVolumeEx.
Decrease the Partition Size
Decreasing the size of the partition also reduces the number of clusters searched. However, breaking a disk up into multiple partitions cans result in running out of space for files more quickly if the partition sizes are not managed carefully. For more information, see PD_CreatePartition.
Avoid Small File Writes and Deletes
Saving a large number of files that are smaller than the cluster size wastes space on the disk because each file occupies at least one full cluster. If you can, use one larger file instead of multiple smaller files. It is not always possible or desirable to concatenate multiple types of information in the same file.