In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "what is the role of linux virtual memory", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the function of linux virtual memory"?
1. Discuss warm-up in front of virtual memory
What we need to know is that the computer divides memory into physical memory and virtual memory (note the difference between virtual memory and virtual address space). Physical memory is the actual memory size of a computer and is made up of RAM chips. Virtual memory is virtual, using disks instead of memory.
two。 How virtual memory works
As described earlier, when the system does not have enough physical memory, some of the physical memory needs to be freed for use by the currently running program.
The free space may come from programs that have not operated for a long time, and the free space is temporarily saved in the swap space, and then the saved data is recovered from the swap space into memory when those programs are about to run.
3. Implementation of Linux virtual memory
There are two ways to realize virtual memory in Linux system, which are swap partition (swap partition) and swap file.
Swap partition
Swapping a partition is actually creating a new partition and mounting that partition as a swap space, using the same steps as the traditional new partition. It's just that formatting and mounting partitions use the mkswap and swapon commands, respectively.
Exchange file
There is not enough space on the hard drive to create a swap partition, so we manually create a swap file to swap the inactive contents of the RAM into it.
4. Ideal exchange weight
Linux allows us to set the weight of the exchange, that is, we can set the frequency of the exchange process. Friends can set the exchange weight between 0 and 100 as needed. A lower value means that the kernel uses less swap as much as possible, and the higher the value, the more the kernel uses swap space.
The default value and recommended value for swapping weights is 60. Interested partners can learn swappiness, the Linux kernel parameter, which is not described too much here.
5. The advantage of using virtual memory it can easily save RAM blocks that are rarely used and occupied. The freed RAM can then be used to accommodate more programs with higher priorities. Prevent the situation in which RAM space is used up and other programs cannot be executed. Virtual memory acts as a backup of RAM, thus increasing the actual space of RAM. During hibernation, all the contents of the RAM are written to swap space. Therefore, virtual memory is required for successful hibernation. It improves the overall performance of the system. (when the kernel parameter swappiness is set properly) at this point, I believe you have a better understanding of "what is the role of linux virtual memory". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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: 0
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.