Linuxfree view memory details

Source: Internet
Author: User
Linuxfree view memory details free View memory details root @ derek :~ # Free-mtotalusedfreesharedbufferscachedMem: 240132351649... Info & n
Linux free View memory details root @ derek :~ # Free-m total used free shared buffers cachedMem: 24013 23516 497 0 155 2699-/+ buffers/cache: 20661 3352 23998 Swap: 10962 13036 www.2cto.com Mem: indicates physical memory-/+ buffers/cache: cache statistics of physical memory Swap: indicates Swap partition on the hard disk (virtual memory) total: total physical memory and virtual memory used: used memory free: Idle memory shared: shared memory buffers: Buffer memory cached: high-speed cache details shared, buffers, cachedShared: for shared memory, it is mainly used to share data between different processes in UNIX environments. it is a method for inter-process communication. generally, applications do not apply to use shared memory. Www.2cto.com Cache: high-speed Cache is a small but high-speed memory located between the CPU and the main memory. Because the CPU speed is much higher than the master memory, it takes a certain period of time for the CPU to directly access data from the memory. the Cache stores part of the data that has just been used by the CPU or is used cyclically, when the CPU uses this part of data again, it can be called directly from the Cache, which reduces the CPU wait time and improves the system efficiency. Cache is divided into Level 1 Cache (L1 Cache) and Level 2 Cache (L2Cache). L1 Cache is integrated into the CPU, and L2 Cache is usually soldered to the motherboard in the early stages, it is also integrated into the CPU. the common capacity is 256KB or 512KB L2 Cache. Buffer: the Buffer zone is used to write data to the memory first when writing data at a high speed and write data to the hard disk from the memory. it is used to transmit data between devices with different storage speeds or devices with different priorities. Through the buffer zone, mutual waits between processes can be reduced, so that when reading data from a slow device, the operation process of the fast device will not interrupt. Cached stores the read data. when you read the data again, you do not need to read the hard disk if it hits (find the required data). if it does not hit the hard disk. The data is organized according to the read frequency, and the most frequently read content is placed in the most easily located location. the unread content is arranged until it is deleted. Buffers is designed based on disk read/write. distributed write operations are performed in a centralized manner to reduce disk fragments and repeated seek paths on the hard disk, thus improving system performance. In linux, a daemon regularly clears the buffer content (such as writing to a disk). You can also use the sync command to manually clear the buffer www.2cto.com buffer and cache (both occupy memory): buffer: the memory used as the buffer cache is the read/write buffer cache of block devices: the memory used as the page cache. the cache of the file system. if the cache value is large, it indicates that the cache contains a large number of files. If files frequently accessed can be cached, the disk read IO bi will be very small. Buffer is about to be written to the disk, and the cache is read from the disk. Buffer is allocated by various processes and used in the input queue. in a simple example, a process requires multiple fields to be read. before all fields are fully read, the process stores previously read fields in the buffer. The cache is often used in disk I/O requests. if multiple processes need to access a file, the file is made into a cache to facilitate next access, this provides system performance. -Buffers/cache (used) indicates the memory used by the program-buffers/cache (used) = used-buffers-cached + buffers/cache (free) memory that can be used in idle mode + buffers/cache (free) = free + buffers + cached www.2cto.com command parameter: free: invalid option -- husage: free [-B |-k |-m |-g] [-l] [-o] [-t] [-s delay] [-c count] [-V] -B, -k,-m,-g show output in bytes, KB, MB, or GB-l show detailed low and high memory statistics-o use old format (no-/+ buffe Rs/cache line) -t display total for RAM + swap-s update every [delay] seconds-c update [count] times-V display version information and exit linux releases cache cached first we need to use the sync command, write all unwritten system buffers to the disk, including modified I-nodes, delayed block I/O, and read/write ing files. Otherwise, unsaved files may be lost during the cache release process. # Sync next, we need to write the required parameters into the/proc/sys/vm/drop_caches file. for example, if we need to release all the caches, enter the following command: # echo 3>/proc/sys/vm/drop_caches www.2cto.com 0-do not release 1-release page cache 2-Release dentries and inodes3-release all caches

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.