Linux command free-m detailed

Source: Internet
Author: User

1. Application Notes

The free command is used to display memory usage. Display information about free and used memory on the system.

The free command provides a more concise view of system memory usage relative to top:

Some of the relevant notes:

Mem: Indicates physical memory statistics

-/+ buffers/cached: Cache statistics representing physical memory

Swap: Indicates the usage of the swap partition on the hard disk ( we don't care here )

Total physical memory of the system: 255268Kb (256M), but the actual memory currently available to the system is not the 16936Kb of the first line of the free tag, it represents only unallocated memory.

We use names such as Total1, Used1, Free1, Used2, and free2 to represent the values of the above statistics, and 1 and 2 represent the data for the first row and the second row respectively.

Total1: Represents the total amount of physical memory.

Used1: Represents the amount that the total is allocated to the cache (including buffers and cache), but may not be actually used in some of the caches.

FREE1: Memory that has not been allocated.

SHARED1: Shared memory, the general system will not be used, nor discussed here.

Buffers1: The number of buffers that are allocated but not used by the system.

Cached1: The number of caches that the system allocates but has not been used. The difference between buffer and cache is shown later.

USED2: The total amount of buffers and caches actually used, as well as the amount of memory actually used.

Free2: The sum of unused buffers with the cache and unallocated memory, which is the current actual memory available to the system.

2. Common parameters

b is displayed in bytes.

-k is displayed in bytes. Displayed by default.

-M is displayed in megabytes.

-S repeats every number of seconds. A script can be written for monitoring.

3. The unit of value is M.

Mem begins with the line: Total refers to the amount of memory. For example, this machine 4G of memory, in fact, has been deducted as video memory part.

Used refers to the number of memory that the operating system has used. This section includes both the part used by the operating system itself, and the part that the application already uses, as well as the cached part.

Free refers to the amount of memory that the operating system has not yet used. We usually see this part relatively small.

GKFX has been deprecated, always showing 0.

Buffers and cached refer to the amount of memory that is cached.
-/+ Buffers/cache start line: (Focus on this line)

The used column refers to the total amount of memory used by the application. Equals mem.used-mem.buffers-mem.cached.

The free column refers to the amount of memory that the application has not yet used. This data is the number of free available memory that we need to focus on. Equals mem.free+mem.buffers+mem.cached. if the data for the free column in this row is too small, then you need to optimize the program or increase the physical memory.

Linux command free-m detailed

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.