当前位置:网站首页>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)]
边栏推荐
- js1day(輸入輸出語法,數據類型,數據類型轉換,var和let區別)
- Obtain file copyright information
- Five best software architecture patterns that architects must understand
- OpenAPI generator: simplify the restful API development process
- 阿里发布的Redis开发文档,涵盖了所有的redis操作
- Numpy array calculation
- Jerry's watch gets the default ringtone selection list [article]
- 每日一题:1175.质数排列
- Unity skframework framework (XIV), extension extension function
- C modifier
猜你喜欢
[opencv learning] [image histogram and equalization]
[opencv learning] [moving object detection]
PR usage skills, how to use PR to watermark?
Web Foundation
2、 Frame mode MPLS operation
Redis database persistence
Analog to digital converter (ADC) ade7913ariz is specially designed for three-phase energy metering applications
Ali on three sides, it's really difficult to successfully get the offer rated P7
[opencv learning] [template matching]
Browser node event loop
随机推荐
2、 Frame mode MPLS operation
Redis数据库持久化
诚邀青年创作者,一起在元宇宙里与投资人、创业者交流人生如何做选择……...
How to get the operating system running PHP- How to get the OS on which PHP is running?
Get started REPORT | today, talk about the microservice architecture currently used by Tencent
[OpenGL] notes 29. Advanced lighting (specular highlights)
Rust language document Lite (Part 1) - cargo, output, basic syntax, data type, ownership, structure, enumeration and pattern matching
Unity SKFramework框架(十六)、Package Manager 开发工具包管理器
Unity skframework framework (XVII), freecameracontroller God view / free view camera control script
JS iterator generator asynchronous code processing promise+ generator - > await/async
MySQL: Invalid GIS data provided to function st_ geometryfromtext
记忆函数的性能优化
Linear DP acwing 899 Edit distance
Mobile layout (flow layout)
OLED screen driver based on stm32
挥发性有机物TVOC、VOC、VOCS气体检测+解决方案
【OpenGL】笔记二十九、高级光照(镜面高光)
Word efficiency guide - word's own template
[opencv learning] [common image convolution kernel]
Jerry's watch ringtone audition [article]