Why is the Unix block size increasing with more memory?

I profile binary data that have

  • increases the size of the Unix block (one of the stat > blocks) when the number of events increases, as shown in the following figure.
  • but the distance between bytes between events remains constant.
  • I noticed some changes in other file fields that might explain the increase in Unix block size

enter image description here

The unix block size is dynamic. I am wondering why it grows with large units of memory in some systems. I had an idea that it should be constant. I used various environments for stat output:

  • Debian Linux 8.1 with default stat
  • OSX 10.8.5 with Xcode 6 and default stat

A Greybeard comment may have an answer to block behavior:

The stat (1) command was a thin CLI for the stat (2) system call, used to transfer the corresponding parts of the inode file. an early sweetheart value of the st_blksize member of structure C returned by stat (2) has been changed to the “preferred” block size for efficient file system I / O, which transfers well to file systems with mixed block sizes or unblocked allocation.

How can you measure the block size in case (1) and (2) separately?

Why is the Unix block size increasing with more memory?

+7
algorithm time-complexity unix memory space-complexity
source share
1 answer

"Status blocks" are not a block size. This is the number of blocks that make up the file. Obviously, the number of blocks is proportional to size. The block size is constant for most file systems (if not all).

+3
source share

All Articles