当前位置:网站首页>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)]
边栏推荐
- Counting class DP acwing 900 Integer partition
- nohup命令
- mac(macos Monterey12.2 m1) 个人使用php开发
- Hundreds of web page special effects can be used. Don't you come and have a look?
- Numpy array calculation
- Unity SKFramework框架(十三)、Question 问题模块
- Jerry's watch stops ringing [article]
- Js3day (array operation, JS bubble sort, function, debug window, scope and scope chain, anonymous function, object, Math object)
- Js1day (input / output syntax, data type, data type conversion, VaR and let differences)
- 腾讯三面:进程写文件过程中,进程崩溃了,文件数据会丢吗?
猜你喜欢

Get started REPORT | today, talk about the microservice architecture currently used by Tencent

自主可控三维云CAD:CrownCAD赋能企业创新设计

Unity SKFramework框架(十九)、POI 兴趣点/信息点

Five best software architecture patterns that architects must understand

Unity skframework framework (XXI), texture filter map resource filtering tool

Interval DP acwing 282 Stone merging

Js2day (also i++ and ++i, if statements, ternary operators, switch, while statements, for loop statements)

最近公共祖先LCA的三种求法

中文姓名提取(玩具代码——准头太小,权当玩闹)

2022零代码/低代码开发白皮书【伙伴云出品】附下载
随机推荐
Ltc3307ahv meets EMI standard, step-down converter qca7005-al33 phy
2、 Frame mode MPLS operation
Unity SKFramework框架(二十)、VFX Lab 特效库
Js5day (event monitoring, function assignment to variables, callback function, environment object this, select all, invert selection cases, tab column cases)
Ntmfs4c05nt1g N-ch 30V 11.9a MOS tube, pdf
Redis database persistence
Unity skframework framework (XVII), freecameracontroller God view / free view camera control script
最近公共祖先LCA的三种求法
Mobile layout (flow layout)
【云原生数据库】遇到慢SQL该怎么办(上)?
Fully autonomous and controllable 3D cloud CAD: crowncad's convenient command search can quickly locate the specific location of the required command.
能自动更新的万能周报模板,有手就会用!
Unity skframework framework (XVI), package manager development kit Manager
Explain in detail the process of realizing Chinese text classification by CNN
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
Five best software architecture patterns that architects must understand
How to get the operating system running PHP- How to get the OS on which PHP is running?
免费SSL证书知多少?免费SSL证书和收费SSL证书的区别
C modifier
Rust language document Lite (Part 1) - cargo, output, basic syntax, data type, ownership, structure, enumeration and pattern matching