In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
What are the ways to swap memory for linux swap? In response to this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more small partners who want to solve this problem find a simpler and easier way.
Swap swap memory mainly refers to when the physical memory is not enough, the system will enable part of the hard disk space to serve as server memory, and by default swap memory will have some setting standards, it is also related to the size of physical memory, the specific standards are as follows:
RAM size Swap Size Total size after Swap activation 256MB 256MB 512MB512MB 512MB 1GB1GB 1GB 2GB3GB 2GB 5GB4GB 2GB 6GB6GB 2GB 8GB8GB 3GB 11GB12GB 3GB 15GB16GB 4GB 20GB32GB 6GB 38GB64GB 8GB 72GB128GB 11GB 139GB
View memory space
free -h
Increase swap space through swap partition files
1. Create files for swap partition
dd if=/dev/zero of=/data2/swapfile bs=1M count=1024
where bs is the size of each block, count is the number of blocks, and bs*count is the size of the swap file: here 1M*1024= 1 G. It can be adjusted as needed. In addition, swapfile is the path to the swap file, which can be modified according to requirements.
2. format swap partition file
mkswap swapfile
The path here corresponds to the previous path.
3. Enable swap partition files
swapon swapfile
4. Add Boot Start
Modify/etc/fstab to add or modify this line:
swapfile swap swap defaults 0 0
Note that the path must still correspond, and it must be a full path. The last two are zeros, not capital O.
This item is not required. If you do not modify the boot configuration, swap space will reset after restart, and the previous configuration will be lost.
When using a java program, we need to set its maximum heap memory, which is a protection for the system.
About linux swap swap memory expansion methods have what questions to share here, I hope the above content can have some help for everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.
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.