Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the memory management method of Linux operating system?

2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the memory management method of the Linux operating system". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the memory management method of the Linux operating system"?

To view memory under Linux, we usually use command free.

[root@nonamelinux ~] # free

Total used free shared buffers cached

Mem: 386024 377116 8908 0 21280 155468

-/ buffers/cache: 200368 185656

Swap: 393552 0 393552

Here is an explanation of these numbers:

The second line (mem):

Total: the total amount of physical memory.

Used: how much has been used.

Free: how many are available?

Shared: the total amount of memory shared by multiple processes.

Buffers/cached: size of the disk cache.

The third line (- / buffers/cached):

Used: how much has been used.

Free: how many are available?

The fourth line does not explain much.

Difference:

The difference between the used/free of the second line (mem) and the third line (- / buffers/cache) used/free.

The difference between the two lies in the use point of view, * line is from the point of view of OS, because OS,buffers/cached belongs to being used, so his available memory is 8908KB, and the used memory is 377116KB, including, the kernel (OS) uses buffers cached used by Application.

The third line refers to that from an application point of view, buffers/cached is equal to available for applications, because buffer/cached is designed to improve file read performance, and buffer/cached is quickly recycled when the application needs to use memory.

So from an application point of view, available memory = system free memory buffers cached.

As in the above example:

1856 656 8908 21280 155468

Next, explain when the memory will be swapped and where to swap.

When the available memory is less than the rated value, a meeting will be held to swap.

How to look at rating (RHEL4.0):

# cat / proc/meminfo

Swapping reduces the number of physical pages used in the system in three ways:

1. Reduce the size of buffers and page cache

two。 Swap out the memory pages of type V of the system,

3. Replace or discard the page. (memory pages occupied by Application, that is, insufficient physical memory).

In fact, the small use of swap does not affect system performance.

Thank you for reading, the above is the content of "what is the memory management method of Linux operating system". After the study of this article, I believe you have a deeper understanding of what the memory management method of Linux operating system is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 301

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report