当前位置:网站首页>Clean up system cache and free memory under Linux
Clean up system cache and free memory under Linux
2022-07-02 13:16:00 【Entry station】
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;sync
Do 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_caches
drop_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 -h
total—— 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
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-dZ6RN2GC-1656667753466)(https://rumenz.com/static/cimg/wx_rumenz.png)]
边栏推荐
- Package management tools
- Sensor adxl335bcpz-rl7 3-axis accelerometer complies with rohs/weee
- Unity SKFramework框架(十六)、Package Manager 开发工具包管理器
- 免费SSL证书知多少?免费SSL证书和收费SSL证书的区别
- Unity skframework framework (XIII), question module
- [OpenGL] notes 29. Advanced lighting (specular highlights)
- 国内首款、完全自主、基于云架构的三维CAD平台——CrownCAD(皇冠CAD)
- Domestic free data warehouse ETL dispatching automation operation and maintenance expert taskctl
- C modifier
- [opencv learning] [moving object detection]
猜你喜欢

伙伴云表格强势升级!Pro版,更非凡!
![[opencv learning] [moving object detection]](/img/2e/9b437b7fe22f1d57334529eda68e37.jpg)
[opencv learning] [moving object detection]

记忆函数的性能优化

VIM super practical guide collection of this one is enough

阿里初面被两道编程题给干掉,再次内推终上岸(已拿电子offer)

What are eNB, EPC and PGW?

挥发性有机物TVOC、VOC、VOCS气体检测+解决方案
![Jerry's watch ringtone audition [article]](/img/18/905c4b64443f4efca55188e36f4b28.jpg)
Jerry's watch ringtone audition [article]

The redis development document released by Alibaba covers all redis operations
![[error record] cannot open](/img/d3/0435ae698ad635be71729c7c047a22.jpg)
[error record] cannot open "XXX" because Apple cannot check whether it contains malware
随机推荐
How can attribute mapping of entity classes be without it?
PXE installation UOS prompt NFS over TCP not available from 10 x.x.x
OLED screen driver based on stm32
Essential for operation and maintenance - Elk log analysis system
Numpy array calculation
The redis development document released by Alibaba covers all redis operations
日本赌国运:Web3.0 ,反正也不是第一次失败了!
Ntmfs4c05nt1g N-ch 30V 11.9a MOS tube, pdf
ADB basic commands
Three methods of finding LCA of the nearest common ancestor
Security RememberMe原理分析
Unity SKFramework框架(十七)、FreeCameraController 上帝视角/自由视角相机控制脚本
挥发性有机物TVOC、VOC、VOCS气体检测+解决方案
Unity skframework framework (XIII), question module
Ali on three sides, it's really difficult to successfully get the offer rated P7
Ltc3307ahv meets EMI standard, step-down converter qca7005-al33 phy
Finally, someone explained the supervised learning clearly
de4000h存储安装配置
Unity SKFramework框架(十三)、Question 问题模块
[opencv learning] [image pyramid]