简体   繁体   中英

Memory management when reading the same file over again

I am wondering if linux keeps something in memory (in order to speed up next time) when reading a text file over and over again ? I am not modifying the text file. Just reading.

Thanks !

Remi

是的,Linux内核会为缓冲磁盘访问分配未使用的内存(这就是为什么如果您使用top会看到在活动使用情况下通常看不到太多可用RAM的原因)

In a linux kernel, the read() system call loads your data in the page cache, if this data is still around next time your perform read() on the same location, then yes, it will read from this cache and speed up things.

you can read a bit up on it in this tutorial and just by researching it in google and other search engines.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM