Read file without disk caching in Linux

前端 未结 2 1594
天命终不由人
天命终不由人 2021-01-04 10:35

I have a C program that runs only weekly, and reads a large amount of files only once. Since Linux also caches everything that\'s read, they fill up the cac

2条回答
  •  既然无缘
    2021-01-04 10:58

    You can use posix_fadvise() with the POSIX_FADV_DONTNEED advice to request that the system free the pages you've already read.

提交回复
热议问题