当前位置:网站首页>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)]
边栏推荐
- 中文姓名提取(玩具代码——准头太小,权当玩闹)
- Word efficiency guide - word's own template
- Jerry's watch reads the alarm clock [chapter]
- net share
- OLED screen driver based on stm32
- 机器学习基础(二)——训练集和测试集的划分
- PXE installation UOS prompt NFS over TCP not available from 10 x.x.x
- 文件的下载与图片的预览
- 8A Synchronous Step-Down regulator tps568230rjer_ Specification information
- Linear DP acwing 899 Edit distance
猜你喜欢

3 a VTT terminal regulator ncp51200mntxg data

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

de4000h存储安装配置

Js4day (DOM start: get DOM element content, modify element style, modify form element attributes, setinterval timer, carousel Map Case)

Everyone wants to eat a broken buffet. It's almost cold

Unity skframework Framework (XVI), package manager Development Kit Manager
![[opencv learning] [image filtering]](/img/4c/fe22e9cdf531873a04a7c4e266228d.jpg)
[opencv learning] [image filtering]

Unity skframework framework (XIV), extension extension function

Unity skframework framework (XX), VFX lab special effects library

记忆函数的性能优化
随机推荐
Oracle from entry to mastery (4th Edition)
JS逆向之行行查data解密
Three methods of finding LCA of the nearest common ancestor
Obtain file copyright information
Js4day (DOM start: get DOM element content, modify element style, modify form element attributes, setinterval timer, carousel Map Case)
OLED screen driver based on stm32
[200 opencv routines] 100 Adaptive local noise reduction filter
Explain in detail the process of realizing Chinese text classification by CNN
Counter attack of flour dregs: MySQL 66 questions, 20000 words + 50 pictures in detail! A little six
What are eNB, EPC and PGW?
linux下清理系统缓存并释放内存
Variable, "+" sign, data type
[opencv learning] [image histogram and equalization]
记忆函数的性能优化
难忘阿里,4面技术5面HR附加笔试面,走的真艰难真心酸
Interesting interview questions
Unity SKFramework框架(十五)、Singleton 单例
Unity SKFramework框架(二十)、VFX Lab 特效库
口袋奇兵点评
Embedded software development