I’m using OpenSUSE, i would like to use some virtual memory of the hard
drive, so i can use more memory for my applications. I cant add an new
memory block in the computer, bcoz its an virtual computer.
So is there any command i can use to use a part of the hard drive as
virtual memory?
GNU/Linux can use swap files as well as swap partitions. It shouldn’t be
difficult to find the exact procedure with uncle Google (it involves
creating the file with dd, using mkswap and putting it in your fstab).
In addition, if your virtual partition is filling up, you could perhaps
add another virtual drive to your guest OS and place the swap file
there.
– http://stopsoftwarepatents.eu/ Even if free software were crap, it should still get our preference
over the non-free crap secreted by IT corporations.
-A free rephrasing of RMS-
If this is a Virtual Machine (you said virtual computer) running on
another machine, then
The virtual machine application(eg vmware, xen, virtualbox, etc)
manages the physical resources on the Host machine used by the Guests
There is little purpose to trying to manage memory usage in the
Guest VMs themselves. You might partition for other purposes but don’t
waste energy specially modifying swap files/partitions for the purpose
of memory management.
How much RAM the host has? And how much is allocated to the VM?
The best way is to increase the VMs allocated memory. You may have to
add more RAM to the host.
Besides that, in linux you can create a temporary swap file, similar to
windows. You are not limited to swap partitions, although they work much
better.
To create a 128 MB swap file in /swap, for example, type as root:
dd if=/dev/zero of=/swap bs=1024 count=131072
mkswap /swap
swapon /swap
Change the number 131072 (128 x 1024) to the size you want. It doesnt
have to be a multiple of 1024, you can use 250000 for example, to make a
~244 MB file.
The /swap file is temporary, should deactivate after rebooting. You can
remove it at any time with: