add virtual memory on centos

free -h

dd if=/dev/zero of=/mnt/swapfile bs=1M count=2048
    if=input_file, of=output_file, bs=block_size

format file: mkswap /mnt/swapfile

mount file: swapon /mnt/swapfile

mount virtual memory when start: 
    vim /etc/fstab:
        /mnt/swapfile swap swap defaults 0 0




猜你喜欢

转载自www.cnblogs.com/otfsenter/p/9541653.html