linux刷新dns缓存_Linux刷新文件系统缓存

在Linux中,可以通过sync命令刷新文件系统缓冲区,然后通过向/proc/sys/vm/drop_caches写入数字来释放页面缓存、dentries和inodes,以释放内存。这个过程是非破坏性的,主要用于清理未使用的和脏对象。
摘要由CSDN通过智能技术生成

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缓存

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值