Linux memory usage of more than 90% -- Solution

Source: Internet
Author: User

Linux system memory usage of more than 90% -- the solution should first clarify the problem: Is the Linux system memory occupied by more than 90% of the normal range? I have a detailed explanation on the Internet, which is a normal phenomenon ~~~ The memory management method for www.2cto.com Linux/Unix systems is different from that for windows. Even for a linux with a low load, after several days, the memory usage will reach more than 90%, even if no one accesses the system, this number is completely normal. However, the memory usage will not reach 100%. Every night, the system will execute/etc/cron. daily to optimize the memory. The Linux/Unix system is very stable. Although the memory usage is more than 90%, it can be ensured that the system does not need to be restarted for more than 365 days. For Linux systems, the main evaluation indicator is the load index for the last five minutes. For example, you can use the w command or top command to view the number "0.70 0.35 0.01, indicates the number of processes in the queue within five minutes, 10 minutes, and 15 minutes. The system is healthy as long as the first number indicates that the load within five minutes is not greater than 5, you do not need to perform any maintenance. If this number is greater than 5, the system speed will usually slow down. Generally, there are several possibilities: www.2cto.com 1) a program occupies a large amount of CPU, use the top command to check whether there is a fault such as a java program locking) 2) a program occupies a large amount of memory, this makes the memory really insufficient (this is the time when the memory needs to be added). For example, because MySQL runs a database with a capacity of GB under a large load, the memory is insufficient, more physical memory needs to be inserted to the server. 3) the read/write failures of the disk system may cause CPU load to rise due to IO throughput errors. The disk needs to be guided to the single-user mode to scan and repair the disk, if the hard disk cannot be repaired, the new hard disk can only be replaced. Therefore, for Linux/Unix system memory Do not worry too much about the percentage occupied. Generally, you can check the system load parameters, but you can also manually release the memory as follows: [root @ ajcheng] # cat/proc/sys/vm/drop_caches 0 first, the value of/proc/sys/vm/drop_caches, the default value is 0 [root @ ajcheng] # sync. Run the sync command manually (Description: The sync command runs the sync subroutine. If you must stop the system, run the sync command to ensure the integrity of the file system. The sync command writes all unwritten system buffers to the disk, including modified I-nodes, delayed block I/O, and read/write ing files) [root @ ajcheng] # echo 3>/proc/sys/vm/drop_caches [root @ ajcheng] # cat/proc/sys/vm/drop_caches 3/proc/sys/vm /drop_caches value is set to 3 [root @ ajcheng] # free-m total used free shared buffers cached Mem: 249 66 182 0 0 11-/+ buffers/cache: 55 194 Swap: 511 0 511 run the free command again. We found that used is 66 MB and free is 182 MB, 0 MB for buffers and 11 MB for cached. the buffer and cache are effectively released.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.