当前位置:网站首页>linux下清理系统缓存并释放内存
linux下清理系统缓存并释放内存
2022-07-01 21:43:00 【51CTO】
当linux频繁读取文件后,物理内存会很快被用完,当程序结束后,内存不会被正常释放,而是一直caching,因此有必要手动清理系统缓存释放内存。
sync
操作系统在运行过程中,会把访问到的文件放到buffer中。为了避免断电,等故障造成数据丢失,我们需要把buffer中的缓存数据写入到磁盘
手动执行sync命令(描述:sync 命令运行 sync 子例程。如果必须停止系统,则运行sync 命令以确保文件系统的完整性。sync 命令将所有未写的系统缓冲区写到磁盘中,包含已修改的 i-node、已延迟的块 I/O 和读写映射文件
手动释放内存的命令
drop_caches的值可以是0-3之间的数字,代表不同的含义:
- 0:不释放(系统默认值)
- 1:释放页缓存
- 2:释放dentries和inodes
查看内存
恢复默认设置
缓存可以提升系统的运行效率,如果发现系统内存经常不够用,应该考虑添加内存,而不是经常清理
原文链接: https://rumenz.com/rumenbiji/linux_drop_caches.html
微信公众号:入门小站
- 回复【1001】获取 linux常用命令速查手册
- 回复【10010】获取 阿里云ECS运维Linux系统诊断
- 回复【10012】获取 Linux学习笔记【强悍总结值得一看】
- 回复【10013】获取 shell简明教程

边栏推荐
- CNN卷积神经网络原理讲解+图片识别应用(附源码)[通俗易懂]
- 面试题:MySQL的union all和union有什么区别、MySQL有哪几种join方式(阿里面试题)[通俗易懂]
- [commercial terminal simulation solution] Shanghai daoning brings you Georgia introduction, trial and tutorial
- 工控设备安全加密的意义和措施
- Why does blocprovider feel similar to provider?
- [NOIP2013]积木大赛 [NOIP2018]道路铺设 贪心/差分
- Matlab traverses images, string arrays and other basic operations
- 详解Volatile关键字
- 【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程
- TOPS,处理器运算能力单位、每秒钟可进行一万亿次
猜你喜欢

【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程

按照功能对Boost库进行分类

Flume面试题

函数基本学习之一

Business visualization - make your flowchart'run'up

基于K-means的用户画像聚类模型

Introduction and download of the latest version of airserver2022

Microsoft, Columbia University | Godel: large scale pre training of goal oriented dialogue

MySQL learning notes - SQL optimization of optimization

Basic operation of binary tree
随机推荐
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
locust 系列入门
【MySQL】数据库优化方法
指标陷阱:IT领导者易犯的七个KPI错误
测试撤销1
Internet of things RFID, etc
Icml2022 | interventional contrastive learning based on meta semantic regularization
Go — 相关依赖对应的exe
分离字符串中的字母和数字并使得字母在前数组在后
vscode的使用
CNN卷积神经网络原理讲解+图片识别应用(附源码)[通俗易懂]
Smart micro mm32 multi-channel adc-dma configuration
[NOIP2013]积木大赛 [NOIP2018]道路铺设 贪心/差分
基于三维GIS的不动产管理应用
Training on the device with MIT | 256Kb memory
都能看懂的LIS(最长上升子序列)问题[通俗易懂]
AirServer手机第三方投屏电脑软件
统计字符中每个字符出现的个数
Several ways of writing main function in C
One of the basic learning of function