In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to expand the swap exchange content of the Linux system, which is very detailed and has a certain reference value. Interested friends must finish reading it!
Swap swap memory mainly means that when there is not enough physical memory, the system will enable part of the hard disk to act as server memory. By default, swap memory has some setting standards, which are also related to the size of physical memory. The specific criteria are as follows:
Ram size Swap size Total size 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 after activating Swap
View memory space:
Free-h
# increase swap space through swap partition files
1. Create a file for the 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=1G. You can adjust it according to your needs.
In addition, swapfile is the path to the swap file and can be modified as needed.
two。 Format swap partition file
Mkswap swapfile
The path here corresponds to the previous path.
3. Enable swap partition files
Swapon swapfile
4. Add boot boot
Modify the / etc/fstab file and add or modify this line:
Swapfile swap swap defaults 0 0
Note that the path still corresponds, and it must be the full path. The last two are zeros, not the capital letter O.
This item is not necessary. If the boot configuration is not modified, the swap space will be reset after reboot, and the previous configuration will be lost.
When using the java program, we need to set its maximum heap memory, which is a protection for the system.
The above is all the content of this article "how to expand the content of swap exchange in Linux system". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.