当前位置:网站首页>Clean up system cache and free memory under Linux
Clean up system cache and free memory under Linux
2022-07-01 22:29:00 【Hua Weiyun】
When linux After reading files frequently , Physical memory will soon run out , When the program is finished , Memory will not be released normally , But all the time caching, Therefore, it is necessary to manually clean up the system cache to free memory .
sync
The operating system is running , The accessed files will be placed in buffer in . To avoid power failure , Data loss caused by faults such as , We need to take buffer Cache data in is written to disk
> sync;sync;syncDo it manually sync command ( describe :sync The command runs sync Subroutines . If you have to stop the system , Then run sync Command to ensure file system integrity .sync Command to write all unwritten system buffers to disk , Include modified i-node、 Delayed block I/O And read-write mapping files
Manual memory release command
> echo 3>/proc/sys/vm/drop_cachesdrop_caches The value of can be 0-3 Number between , It means different things :
- 0: Don't release ( System default )
- 1: Free page cache
- 2: Release dentries and inodes
Look at the memory
> free -htotal—— Total physical memory used—— Used memory , Generally, this value will be relatively large , Because this value includes cache+ Memory used by the application free—— Completely unused memory shared—— Application shared memory buffers—— cache , It's mainly used for catalogues ,inode It's worth waiting for (ls Large directories can see this value increase )cached—— cache , For open files Restore default settings
Caching can improve the efficiency of the system , If you find that the system memory is often insufficient , You should consider adding memory , Instead of cleaning up often
> echo 0>/proc/sys/vm/drop_caches Link to the original text :https://rumenz.com/rumenbiji/linux_drop_caches.html
WeChat official account : Entry station
- reply 【1001】 obtain linux Quick reference manual of common commands
- reply 【10010】 obtain Alibaba cloud ECS Operation and maintenance Linux System diagnosis
- reply 【10012】 obtain Linux Learning notes 【 The strong summary is worth seeing 】
- reply 【10013】 obtain shell A concise tutorial

边栏推荐
- What is the difference between consonants and Initials? (difference between initials and consonants)
- MySQL系列之事务日志Redo log学习笔记
- MySQL empties table data
- 【juc学习之路第9天】屏障衍生工具
- 指标陷阱:IT领导者易犯的七个KPI错误
- Aidl basic use
- Separate the letters and numbers in the string so that the letters come first and the array comes last
- idea中类中显示成员变量和方法
- 为什么数字化转型战略必须包括持续测试?
- 【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程
猜你喜欢

MySQL系列之事务日志Redo log学习笔记

Spark面试题

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

【juc学习之路第9天】屏障衍生工具

“丝路正青春 风采看福建”在闽外籍青年短视频大赛火热征集作品中
![[deep learning] use deep learning to monitor your girlfriend's wechat chat?](/img/03/ecf50eacc91c0633b0d9689cdad2c2.png)
[deep learning] use deep learning to monitor your girlfriend's wechat chat?

【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!

基于LSTM模型实现新闻分类
![[intelligent QBD risk assessment tool] Shanghai daoning brings you leanqbd introduction, trial and tutorial](/img/ac/655fd534ef7ab9d991d8fe1c884853.png)
[intelligent QBD risk assessment tool] Shanghai daoning brings you leanqbd introduction, trial and tutorial

从MLPerf谈起:如何引领AI加速器的下一波浪潮
随机推荐
分离字符串中的字母和数字并使得字母在前数组在后
灵动微 MM32 多路ADC-DMA配置
Pytest Collection (2) - mode de fonctionnement pytest
burpsuite简单抓包教程[通俗易懂]
Using closures to switch toggle by clicking a button
Make a three digit number of all daffodils "recommended collection"
【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程
LIS (longest ascending subsequence) problem that can be understood [easy to understand]
GaussDB(DWS)主动预防排查
[deep learning] use deep learning to monitor your girlfriend's wechat chat?
Case of camera opening by tour
AIDL基本使用
Simple interactive operation of electron learning (III)
Four methods of JS array splicing [easy to understand]
Significance and measures of security encryption of industrial control equipment
Training on the device with MIT | 256Kb memory
Test cancellation 1
MySQL系列之事务日志Redo log学习笔记
Can I choose to open an account for stock trading on flush? Is it safe?
CNN卷积神经网络原理讲解+图片识别应用(附源码)[通俗易懂]