Reputation: 6008
How to find the disk write buffer size in Linux?
Upvotes: 4
Views: 9665
Reputation: 11
Data stored in buffer while you copy file for example to USB is in "Dirty" memory.
Try mount your USB flash disk and #pv file.5GB.. > /media/.../diskname/ it goes quickly and after while hang.. because it fill the buffer in dirty memory
in another terminal #cat /proc/meminfo | grep Dirty Dirty memory take a lot of space. pv raises transfer to 100% and hangs.. Dirty memory take maximum amount and then slowly goes to zero. When it happen, pv ends succesfully.
Upvotes: 0
Reputation: 136256
write
system call normally just copies your data to the page cache, which later on gets flushed to the disk. The size of the page cache is dynamic, the kernel tries to use all free memory for it.
See The Page Cache and Page Writeback for more details.
Upvotes: 2