I told a friend that I have been using Linux
He asked me why Linux
The memory used is so high. He told me that the internal free space of 1 GB is mb. Windows XP only uses MB.
Actually, the Linux memory is very informative.
The following shows the usage of the current memory.-M indicates that the content is displayed in MB bytes. Let's take a look.
$ Free-m
Total used free shared buffers cached
Mem: 1002 769 232 0 62 421
-/+ Buffers/cache: 286 715
Swap: 1153 0 1153
Part 1 mem row:
Total memory: 1002 MB
Used memory used: 769 MB
Free idle memory: 232 MB
Shared is no longer used. It is always 0.
Buffers buffer cache memory: 62 MB
Cached page cache memory: 421 MB
Link: Total (1002 m) = used (769 m) + free (232 m)
Part 2 (-/+ buffers/cache ):
(-Buffers/cache) used memory size: 286 MB (refers to used-Buffers-cached in the first part of the mem row)
(+ Buffers/cache) free memory: 715 MB (refers to the first part of the mem row free + buffers + cached)
It can be seen that-Buffers/cache reflects the memory actually eaten by the program, while + buffers/cache reflects the total number of memories that can be used.
The third part refers to the exchange
Partition.
I think you are still dizzy after reading the above. The first part (MEM) and the second part (-/+ buffers/cache) are so strange about used and free.
In fact, we can explain it in two ways.
For the operating system, it is the mem parameter. buffers/cached are all used, so it is considered that free is only 232.
For applications (-/+ buffers/cach ). buffers/cached is equivalent to available, because buffer/cached is used to improve the performance of program execution. When the program uses memory, buffer/cached will be quickly used.
So let's take a look at the application,
To (-/+
The free and used of buffers/cache are the main ones. So let's take a look at this. In addition, I would like to tell you some common sense. In order to improve the disk and memory access efficiency of Linux,
Linux has made a lot of elaborate designs, except for caching dentry (for VFS, to accelerate the conversion from file path name to inode ),
Two major cache methods are also adopted: buffer cache and page
Cache. The former is used to read and write disk blocks, and the latter is used to read and write inode files. These caches can effectively shorten
The time when the I/O system calls (such as read, write, getdents.
Remember that the memory is used.
Not like Windows. No matter how much physical memory you have, you must exchange hard disks.
Text
This is why Windows often prompts insufficient virtual space. You can think about it, it's boring. When there is still a large amount of memory, you can use some hard disk space to act as memory.
Will be faster than memory. therefore, in Linux, as long as the swap space of swap is not used, we don't have to worry about having too little memory. if many swap instances are used, you may need to add physical memory. this is also
It is the standard for Linux to check whether the memory is sufficient.