当前位置:网站首页>Clean system cache and free memory under Linux
Clean system cache and free memory under Linux
2022-06-24 01:44:00 【Introductory notes】
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
边栏推荐
- [read together] Web penetration attack and defense practice (I)
- Property management source code based on wechat applet
- Virtual currency mining detection and defense
- 4-data persistence and shared interconnection
- How to choose a website construction company self-study website or website construction company
- Web user experience design promotion practice
- How to self-study website construction is website construction company reliable
- Can the fortress machine connect to the ECS? What are the reasons why the fortress cannot connect to the ECS?
- Analysis of the whole process of webapck5 core packaging principle
- Collation of commonly used glusterfs commands
猜你喜欢

I, a 27 year old female programmer, feel that life is meaningless, not counting the accumulation fund deposit of 430000
![[SQL injection 12] user agent injection foundation and Practice (based on burpsuite tool and sqli labs LESS18 target machine platform)](/img/c8/f6c2a62b8ab8fa88bd2b3d8f35f592.jpg)
[SQL injection 12] user agent injection foundation and Practice (based on burpsuite tool and sqli labs LESS18 target machine platform)
![[SQL injection 13] referer injection foundation and Practice (based on burpseuite tool and sqli labs less19 target platform)](/img/b5/a8c4bbaf868dd20b7dc9449d2a4378.jpg)
[SQL injection 13] referer injection foundation and Practice (based on burpseuite tool and sqli labs less19 target platform)

It's too difficult for me. Ali has had 7 rounds of interviews (5 years of experience and won the offer of P7 post)
随机推荐
Typescript type system
Video stream playback address redirection optimization after easycvr replaces the new kernel
Blog platform was falsely blackmailed and the new hacker organization claimed responsibility for the Israeli attack | November 16 global network security hotspot
Build a smart drug supervision platform based on easycvr video technology and build a drug safety firewall
Easynvr background channel list timing request touchstreamclient interface optimization
什麼是養老理財?養老理財產品有哪些?
[technical grass planting] look what I did with my server!
Netease Shufan: Data productivity platform 2.0 promotes "everyone uses data and always uses data"
Coding compass -- creating a software factory like a flowing cloud
What is the cost of domain name trademark registration? What is the use of domain names and trademarks?
[SQL injection 13] referer injection foundation and Practice (based on burpseuite tool and sqli labs less19 target platform)
Tcapulusdb Jun · industry news collection
[SQL injection 12] user agent injection foundation and Practice (based on burpsuite tool and sqli labs LESS18 target machine platform)
Tcapulusdb Jun · industry news collection
Cloud computing "keeping the promise"
[combat power upgrade] Tencent cloud's first arm architecture instance was launched! Experience the new architecture computing power!
Troubleshooting and repair of easygbs docking with universal video equipment to broadcast message 487
[technical grass planting] cdn+ lightweight server +hugo= let the blog "cloud native"
Note 3 of disruptor: basic operation of ring queue (without disruptor class)
Online and offline integrated operation of channel sales system in the home furnishing industry to promote product update and iteration