Linux system memory consumption more than 90%?

Source: Internet
Author: User

Problem:
[[email protected] zx_epp_db]# free-m       Total used       free     shared    buffers     cachedmem:         15953      14706       1246          0      12687-/+ buffers/cache:       1979      13973Swap:         8015         27       7988
---------------------------------------------------------------------------------------------------------- ----------------------------------

First, you need to identify a problem: Linux system memory consumption is more than 90%, is the normal range? Online has a detailed explanation, this is normal phenomenon ~ ~ ~ Linux/unix System Management of memory and Windows is not the same, even a small load of Linux, running a few days, memory consumption will reach more than 90%, even if no access, this number is completely normal. However, this memory footprint will not reach 100%, and every night the system performs/etc/cron.daily for memory optimization. Linux/unix system is very robust, although memory consumption shows more than 90%, but still can guarantee more than 365 days without restarting. For Linux systems, the main indicator of the stress is the last 5 minutes of load index: for example, with the W command or top to see, you can see "0.70 0.35 0.01" such as the number, respectively, in 5 minutes, 10 minutes, 15 minutes queued in the number of processes, As long as the first number is not more than 5 of the load in 5 minutes, the system is healthy, do not have to do any maintenance; If this number is greater than 5, then usually the system speed will be slow, generally there are several possible: 1) A program consumes a large number of CPUs, Use the top command to check (see if there is a problem with Java program deadlock) 2) a program consumes a lot of memory, so that memory is really not enough (this is the time to really need to add memory), such as MySQL under a large load of the running capacity of the GB-level database caused insufficient memory, Need to insert more physical memory into the server 3) disk system read and write failure, IO throughput error caused CPU load rise, need CD-ROM boot into single-user mode scan repair Disk, repair can only replace the new hard disk therefore, for the Linux/unix system memory consumption of the percentage, need not care too much, General check the system load parameters can be

but also manual memory release, the following:  
12 [[email protected] mysql]# cat /proc/sys/vm/drop_caches0

First, the value of/proc/sys/vm/drop_caches, which defaults to 0

[[email protected] mysql]#  Sync

Perform the sync command manually (description: 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 the non-writable system buffers to disk, including modified I-node, deferred block I/O, and read-write mapping files.

[[email protected] mysql]# echo 3 >/proc/sys/vm/drop_caches [[email protected] mysql]# cat/proc/sys/vm/drop_caches 3

Set the/proc/sys/vm/drop_caches value to 3

12345 [[email protected] mysql]# free -m             total       used       free     shared    buffers     cachedMem:         15953       2914      13038          0          4         51-/+ buffers/cache:       2858      13094Swap:         8015         23       7992

Run the free command again and find that the current used is 66mb,free to 182mb,buffers for 0mb,cached to 11MB. The buffer and cache are released effectively.

Linux system memory consumption more than 90%?

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.