How Linux system analyzes Cache in memory

  
                

Cache is a static cache file in memory. Sometimes the Cache file in memory can become very large and can reach 4G, which even exceeds the memory capacity. What is going on? Let's talk about how the Linux system analyzes the Cache in memory.

In order to verify this result, the first is to randomly vi a large file, and then check to see if the cache changes.

Then look for the tool to verify that it is the file in the file.

Finally, it is concluded that linux will cache the edited files.

The official default source code, the newline is windows, after downloading the source code, you need to modify the line break, otherwise the installation error. Need to replace linux-ftools_modify.zip to complete the replacement of newline characters.

Modify the permissions before packaging, increase the permissions to execute the script

chmod 755 -R *

Packing instructions

. /configure

make && make install

View cache commands (only valid for files in the current directory)

linux-fincore --pages=false -- Summarize --only-cached *

Output

[root@dev-suning tmp]# linux-fincore --pages=false --summarize --only-cached *

filename size total_pages min_cached page cached_pages cached_size cached_perc

-------- ---- ----------- ----------- ---- ------------ ----------- -----------

Could not mmap file: linux -ftools: No such device

Could not mmap file: linux-ftools-new: No such device

Could not mmap file: redis-2.8.19: No such device

wildfly-8.1.0.Final.tar.gz 115,995,207 28,320 0 28,320 115,998,720 100.00

---

total cached size: 115,998,720

The following is a screenshot

At the beginning, the cache is only 40M

With the vi editor, the wildfly is turned on. About 110M)

with a cache analysis tool to see if the file is

These are the Linux file analysis methods Cache, and after the analysis of Cache Cache know The process of production. If you want to clean up the Cache, you can refer to: How to clean up the swap, buffer and cache in Linux.

Copyright © Windows knowledge All Rights Reserved