linux刷新dns缓存
We may drop the file system caches on Linux to free up memory for applications. Kernels 2.6.16 and newer provide a mechanism via the /proc/
to make the kernel drop the page cache and/or inode and dentry caches on command. We can use this mechanism to free up the memory. However, this is a non-destructive operation that only free things that are completely unused and dirty objects will not be freed until written out to disk. Hence, we should flush these dirty objects to disk first. We can run sync to flush them out to disk. And the drop operations by the kernel will free more memory.
我们可能会在Linux上删除文件系统缓存,以释放应用程序的内存。 内核2.6.16及更高版本通过/proc/
提供了一种机制 ,以使内核根据命令删除页面缓存和/或inode和dentry缓存。 我们可以使用这种机制释放内存。 但是,这是一种非破坏性的操作,只有释放完全未使用的东西和脏对象之后,才将其释放到磁盘中,然后再释放它们。 因此,我们应该先将这些脏对象冲洗到磁盘上。 我们可以运行同步以将它们刷新到磁盘。 内核的删除操作将释放更多的内存。
We can flush caches of the file systems by two steps:
我们可以通过两个步骤来刷新文件系统的缓存:
刷新文件系统缓冲区 (Flush file system buffers)
Call the sync command:
调用sync命令:
# sync
免费的页面缓存,牙科和索引节点 (Free pagecache, dentries and inodes)
Just echoing a number to /proc/sys/vm/drop_caches:
只是在/ proc / sys / vm / drop_caches中回显一个数字:
# echo 3 > /proc/sys/vm/drop_caches
翻译自: https://www.systutorials.com/linux-flushing-file-system-caches/
linux刷新dns缓存