当前位置:网站首页>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简明教程

边栏推荐
- Mask wearing detection method based on yolov5
- EasyExcel 复杂数据导出
- Medium pen test questions: flip the string, such as ABCD, print out DCBA
- AIDL基本使用
- 【智能QbD风险评估工具】上海道宁为您带来LeanQbD介绍、试用、教程
- Introduction à l'ingénierie logicielle (sixième édition) notes d'examen de Zhang haifan
- 完全注解的ssm框架搭建
- List announced | outstanding intellectual property service team in China in 2021
- CNN卷积神经网络原理讲解+图片识别应用(附源码)[通俗易懂]
- js如何获取集合对象中某元素列表
猜你喜欢

详解LockSupport的使用

One of the basic learning of function

AirServer2022最新版功能介绍及下载

详解JMM

Aidl basic use
![[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!](/img/27/4bd0de716f5cb360d54f140dc8e9c1.png)
[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!

从零开始学 MySQL —数据库和数据表操作

mysql 学习笔记-优化之SQL优化

News classification based on LSTM model

【智能QbD风险评估工具】上海道宁为您带来LeanQbD介绍、试用、教程
随机推荐
[NOIP2013]积木大赛 [NOIP2018]道路铺设 贪心/差分
【STM32】STM32CubeMX教程二–基本使用(新建工程点亮LED灯)
js数组拼接的四种方法[通俗易懂]
plantuml介绍与使用
C中main函数的几种写法
二叉树的基本操作
A debugging to understand the slot mechanism of redis cluster
Manually implement function isinstanceof (child, parent)
Using closures to switch toggle by clicking a button
[commercial terminal simulation solution] Shanghai daoning brings you Georgia introduction, trial and tutorial
【深度学习】利用深度学习监控女朋友的微信聊天?
多种智能指针
The difference between NiO and traditional IO
[STM32] stm32cubemx tutorial II - basic use (new projects light up LED lights)
信标委云原生专题组组长,任重道远!
Why does blocprovider feel similar to provider?
Sonic云真机学习总结6 - 1.4.1服务端、agent端部署
基于三维GIS的不动产管理应用
Can you get a raise? Analysis on gold content of PMP certificate
Spark interview questions