当前位置:网站首页>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)]
边栏推荐
- 能自动更新的万能周报模板,有手就会用!
- VIM super practical guide collection of this one is enough
- Ruby: how to copy variables without pointing to the same object- Ruby: how can I copy a variable without pointing to the same object?
- Daily question: 1175 Prime permutation
- 伙伴云表格强势升级!Pro版,更非凡!
- Js1day (input / output syntax, data type, data type conversion, VaR and let differences)
- Five best software architecture patterns that architects must understand
- Unforgettable Ali, 4 skills, 5 hr additional written tests, it's really difficult and sad to walk
- Day4 operator, self increasing, self decreasing, logical operator, bit operation, binary conversion decimal, ternary operator, package mechanism, document comment
- Interesting interview questions
猜你喜欢

Crowncad (crown CAD), the first fully independent 3D CAD platform based on Cloud Architecture in China

Redis database persistence

嵌入式软件开发

Ntmfs4c05nt1g N-ch 30V 11.9a MOS tube, pdf

Js1day (syntaxe d'entrée / sortie, type de données, conversion de type de données, Var et let différenciés)

运维必备——ELK日志分析系统
![Jerry's watch ringtone audition [article]](/img/18/905c4b64443f4efca55188e36f4b28.jpg)
Jerry's watch ringtone audition [article]

C operator

Linear DP acwing 899 Edit distance

Embedded software development
随机推荐
日本赌国运:Web3.0 ,反正也不是第一次失败了!
最近公共祖先LCA的三种求法
国产免费数据仓库ETL调度自动化运维专家—TASKCTL
Std:: vector batch import fast de duplication method
Unity SKFramework框架(二十一)、Texture Filter 贴图资源筛选工具
MySQL: Invalid GIS data provided to function st_ geometryfromtext
Ali on three sides, it's really difficult to successfully get the offer rated P7
C modifier
阿里初面被两道编程题给干掉,再次内推终上岸(已拿电子offer)
Finally, someone explained the supervised learning clearly
Web Foundation
Async/await asynchronous function
操作教程:EasyDSS如何将MP4点播文件转化成RTSP视频流?
完全自主可控三维云CAD:CrownCAD便捷的命令搜索,快速定位所需命令具体位置。
口袋奇兵点评
挥发性有机物TVOC、VOC、VOCS气体检测+解决方案
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
3 a VTT terminal regulator ncp51200mntxg data
Js2day (also i++ and ++i, if statements, ternary operators, switch, while statements, for loop statements)
OLED screen driver based on stm32