I found what I believe to be odd behavior on an OpenSuSE 11.0 computer today.
I needed to add some disk space on one of our computers and here is what I did: This computer had a separate disk for swap space so I deactivated swap (swapoff -a) and then removed the swap entry from /etc/fstab. I then shut down the computer and replaced what was a single disk used only for swap with a RAID1 hardware mirror.
I then booted the system and added a swap partition and another file system on the new RAID1 volume. Even after activating the new swap space with swap on, no swap ever seems to be actually allocated. The swap space shows up in top, free, “swap -s” and vmstat, but never gets used.
I realize that a reboot will result in the swap being used, but is there anyway to get the kernel to use the swap without a reboot.
It’s probably worth noting that I verified this behavior on a second computer. That is I turned off swap, removed the swap entry in /etc/fstab and then rebooted. Swap is never actually allocated until a second reboot.
By the way, this was discovered when some of our users attempted to run java on the system where I did the first work and they got:
prompt> java -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Yesterday, java was working fine and I got the same results on my test computer.
Is this a kernel bug or just odd behavior?
TIA
On 04/15/2010 01:46 PM, schaffin wrote:
>
> I found what I believe to be odd behavior on an OpenSuSE 11.0 computer
> today.
>
> I needed to add some disk space on one of our computers and here is
> what I did: This computer had a separate disk for swap space so I
> deactivated swap (swapoff -a) and then removed the swap entry from
> /etc/fstab. I then shut down the computer and replaced what was a
> single disk used only for swap with a RAID1 hardware mirror.
>
> I then booted the system and added a swap partition and another file
> system on the new RAID1 volume. Even after activating the new swap
> space with swap on, no swap ever seems to be actually allocated. The
> swap space shows up in top, free, “swap -s” and vmstat, but never gets
> used.
>
> I realize that a reboot will result in the swap being used, but is
> there anyway to get the kernel to use the swap without a reboot.
>
> It’s probably worth noting that I verified this behavior on a second
> computer. That is I turned off swap, removed the swap entry in
> /etc/fstab and then rebooted. Swap is never actually allocated until a
> second reboot.
>
> By the way, this was discovered when some of our users attempted to run
> java on the system where I did the first work and they got:
>
> prompt> java -version
> Error occurred during initialization of VM
> Could not reserve enough space for object heap
> Could not create the Java virtual machine.
>
> Yesterday, java was working fine and I got the same results on my test
> computer.
>
> Is this a kernel bug or just odd behavior?
Using swapon should have worked. Did you ‘mkswap’? The full set of steps is:
Create swap partition or swap file
mkswap <what you just created>
swapon <what you just formatted>
Add it to /etc/fstab
I did this all through yast. I’ll make some swap on my test computer today and see if it behaves the same way when I do this “by hand”.
Thanks.
On 04/19/2010 08:26 AM, schaffin wrote:
>
> I did this all through yast. I’ll make some swap on my test computer
> today and see if it behaves the same way when I do this “by hand”.
Always remember that YaST is a GUI frontend to the commands. If you do
it correctly “by hand”, you will do exactly what YaST did.
I’m curious - what’s the current status of your swap partition “research project”?