首页 > 应用开发 > IT综合 > tempfile空间分配的时机--访问块时
When you create or resize tempfiles, they are not always guaranteed allocation
of disk space for the file size specified. On certain file systems (for example,
UNIX) disk blocks are allocated not at file creation or resizing, but before the
blocks are accessed.
Caution: This enables fast tempfile creation and resizing;
however, the disk could run of space later when the tempfiles are
accessed.
在创建或resize后,接下来做一个大的排序操作,让空间得到分配,这样真正到了用的时候就不会花时间在allocate上了.
并且可以避免因为一开始得不到分配,访问时才分配的另一个滞后影响:后面可能空间不够分配。
可以测试一下影响.
[@more@]来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/94384/viewspace-1010953/ ,如需转载,请注明出处,否则将追究法律责任。