Linux increases virtual memory

Source: Internet
Author: User

Basic idea: Create a swapfile file--format to swap format--enable virtual disk.

    1. Build Swapfile, size 1G

# dd If=/dev/zero of=/var/swapfile bs=10k count=102400

Description: Create a file of size 1G swapfile. "DD" This command,"If" specifies the source,/Dev/zero is an input device that initializes the file with it . "of" specifies the target file, "BS" defines the size of the block, "Count" defines the number of blocks, and these two parameters determine the target file size = bs x count.

2. Format the virtual memory file

# mkswap-f/var/swapfile

3. Activating virtual Memory files

# Swapon/var/swapfile

4. Set boot automatically mount virtual memory file

#vim/etc/fstab

Add code:

/var/swapfile swap swap defaults 0 0


This article is from the "qi" blog, please be sure to keep this source http://garany.blog.51cto.com/7342714/1774639

Linux increases virtual memory

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.