Linux commands: Free command-show memory information

Source: Internet
Author: User

Free command

Function description

the free command is used to display system memory status, including system physical memory, virtual memory, shared memory, and system cache. Use the following:

free [options] [-s (interval seconds)]

Command parameters

Options Meaning
-M Display memory usage in megabytes
-B Display memory usage in bytes
-K Display memory usage in kilobytes
-T Show Memory Sum column
-S (interval seconds) Continuously displays memory usage based on the number of seconds specified
-C Count, which needs to be used in conjunction with the-s option
-O Do not display system buffer columns

Common combinations:

free-m          

free-m-S 1     #每秒以MB为单位, displaying system memory details

free-c 4-s 2   #每2秒执行一次, showing system memory usage, total 4

Example

Use the- m parameter to view memory utilization

[[email protected] ~]#  free-m

mem:           1826                1487   &NBSP ;       8         206        1528

swap:          3071           0        3071 /p>

Description

As can be seen from the above display, the total memory is 2G, has used 132MB, the available memory has 1487MB. Swap swap is a zone size of 3G and is not used by the system.

Use the-s parameter to view memory utilization per second

[[email protected] ~]# free-m-S 1

Total used free shared buff/cache available

mem:1826 132 1488 8 206 1528

swap:3071 0 3071


Total used free shared buff/cache available

mem:1826 132 1488 8 206 1528

swap:3071 0 3071


Total used free shared buff/cache available

mem:1826 132 1488 8 206 1528

swap:3071 0 3071


^c

[[Email protected] ~]

use the-c parameter, display memory information in 2 seconds, total 3 times

[email protected] ~]# free-c 3-s 2

Total used free shared buff/cache available

mem:1870516 135212 1523720 8624 211584 1565692

swap:3145724 0 3145724


Total used free shared buff/cache available

mem:1870516 135228 1523704 8624 211584 1565676

swap:3145724 0 3145724


Total used free shared buff/cache available

mem:1870516 135228 1523704 8624 211584 1565676

swap:3145724 0 3145724

[Email protected] ~]#


Learn from:

Karst "Progressive Linux"

This article is from the "Zhao Dongwei blog" blog, make sure to keep this source http://zhaodongwei.blog.51cto.com/4233742/1874965

Linux commands: Free command-show memory information

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.