Score:0

What is the delete target of "echo 2 > /proc/sys/vm/drop_caches" command

bf flag
sync
echo 2 > /proc/sys/vm/drop_caches

After I execute above command, available memory is significantly increased than below consumed Slab memory.

cat /proc/meminfo | grep Slab
Slab:    6169212 kB

What is the delete target of "echo 2 > /proc/sys/vm/drop_caches" command

in flag
Are you asking what *files* are being deleted when you issue this command? If so, there are no files. When you drop the caches you are flushing file buffers. These are sections of (or complete) files that are currently being used by the operating system. The point of the buffers is to reduce the number of times the same file is read from disk. This ensures the system is able to more quickly handle commonly-accessed files. Dropping these caches will force the OS to re-read the files at least once the next time the system does something requiring those libraries/resources.
M.Ozawa avatar
bf flag
Whose allocated memory will this command free? Other than Slab?
Score:2
vn flag

The files in /proc/sys/vm can be used to tune the operation of the virtual memory (VM) subsystem of the Linux kernel. This is documented in the kernel documentation:

drop_caches

Writing to this will cause the kernel to drop clean caches, as well as reclaimable slab objects like dentries and inodes. Once dropped, their memory becomes free.

To free pagecache:

echo 1 > /proc/sys/vm/drop_caches

To free reclaimable slab objects (includes dentries and inodes):

echo 2 > /proc/sys/vm/drop_caches

To free slab objects and pagecache:

echo 3 > /proc/sys/vm/drop_caches
M.Ozawa avatar
bf flag
Thank you for your answer! When I executed `echo 2 > /proc/sys/vm/drop_caches`, Available memory is increased than Slab memory(`cat /proc/meminfo | grep Slab`). I don't know the reason.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.