How to Enlarge Virtual Memory for Fedora 7 and Solaris
Sometimes physical memory is not enough for us to run some kinds of service. We need more virtual memory. The following is an example to create 2G virtual memory for Redhat Fedora 7 and Sun Solaris 9.
1. Redhat Fedora 7
First of all, we need to create 2G file. /dev/zero is a special file that provides as many null characters as are read from it.
[root@henrydu /]# dd if=/dev/zero of=/swapfile bs=1024 count=2048000
2048000+0 records in
2048000+0 records out
2097152000 bytes (2.1 GB) copied, 61.6084 s, 34.0 MB/s
Secondly, we need to set up swapfile.
[root@henrydu /]# mkswap /swapfile
Setting up swapspace version 1, size = 2097147 kB
Thirdly, Enable swapfile.
[root@henrydu /]# swapon /swapfile
At last, Edit /etc/fstab to enable it at boot time.
/swapfile swap swap defaults 0 0
You also can check swap space by
[root@henrydu /]# cat /proc/swaps
Filename Type Size Used Priority
/dev/mapper/VolGroup00-LogVol01 partition 1048568 363324 -1
/swapfile file 2047992 0 -2
2. Sun Solaris 9
First of all, we need login as super user by typing “su -”.
Secondly, check the current swap file and plan how big file do we need to create.
swap -l
Thirdly, make a swap file, say, 2G file named swapfile001.
mkfile 2g /swapfile/swapfile001
Then, make the file as part of virtual memory.
swap -a /swapfile/swapfile001
Last, reboot the sun box.
Discussion Area - Leave a Comment