Understand linux memory

Source: Internet
Author: User
Understand the linux memory-general Linux technology-Linux programming and kernel information. The following is a detailed description. After carefully reading this article titled "computing memory usage", I am still in a semi-confused state. The author said that there is no particularly good tool for displaying memory usage in Linux. Although there are top and free tools, it is just like the magic of Wuxi.

For example, the top tool will display three types of data. The author explains them as follows:

VIRT: virtual memory usage. The word "Virtual" is very powerful. The general explanation is: virtual. Virtual, real, [thing] effective, in fact. Is it virtual or real? After Google gives Define, it will understand that this is a non-material thing, but it has an effect, not in the real world, but in the software world, and so on. This memory usage is the address space occupied by an application. If it is only required by the application, it is all here, no matter whether it is used or not. It is normal to open more memory when writing programs for fear of errors and do not care about usage.

RES: resident memory usage. Resident memory. This value is the memory actually used by the application, but there are two other small problems: first, some items may be stored on the SWAP disk (SWAP), and second, some memory may be shared.

SHR: shared memory. Shared Memory. That is to say, this memory space may also be used by other applications. Virt-Shr seems to be what this program requires and has no shared memory space.

DATA: Memory occupied by DATA. If top is not displayed, press f to display it. This is the real data space required by the program and is actually used during running.

Therefore, the meaning of DATA is relatively definite and can even be calculated using the DATA size read by the program. SHR is a potential number that may be shared. If only one program is opened, no one else uses it. VIRT has more possibilities. For example, it may calculate the memory shared by many X libraries. RES should be more accurate, but it does not include swap-out space; but it can basically be said that RES is the amount of memory currently used by the program.

I will understand the meaning of these points as well as gains. I have no strength to study such advanced things. Recently, I feel that Firefox is better to be used in Linux than in windows. It shows that there are fewer chances of freezing and the freezing time is shorter. When there are a large number of images on a page, it is better than Win, maybe it indicates what is clever about Linux in memory management or process scheduling?
Related Article

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.