Hey guys,
Has anyone run into an issue where a vm tries to use more memory that is assigned to it and the vm can't get the memory?
We have a RHEL 4 32 bit vm that has 2 gigs assigned to it. My linux guy says that process 2779 (java) was out of memory. And that the only way to get it to use more than 512 megs was to apparently reboot the vm.
Anyone ever run into this kind of thing before? This has happened on other linux vms before and reboot was the answer. Other vms on the same host seem to be ok.
Thank you,
Matthew
Kaizen!
Hi Matthew,
Sounds weird, is the swap partition properly setup?
You can see the amount of swap that is setup/user using either the top or the free command.
The total column for swap in the output of those commands should not be 0.
You can also check if swap is used by running:
swapon -s
If swap is not properly setup then as soon as your host runs out of memory it can only crash an application in order to get more memory.
If you have a swap partition (let's take sda2 here as an example), then you first have to prepare it:
mkswap /dev/sda2
and you can enable it using swapon:
swapon /dev/sda2
For this after a reboot to be used again, you'll have to add it to the /etc/fstab file like:
/dev/sda2 swap swap defaults 0 0
Hope this helps,
--
Wil
_____________________________________________________
VI-Toolkit & scripts wiki at http://www.vi-toolkit.com
Are you sure the java app is configured correctly with the -xms and -xmx parameters to actually 'fit' within the assigned RAM size? This is an application thing and has nothing to do with the VM.
Hey Guys,
I am leaning towards this being an application issue as well. The only reason it might be an infrastructure issue is because when the linux guy issued the
Free -tm command, the server returned the following:
Total = 2027
Used = 571
Free = 1455
Swap = 1027
Used = 0
Free = 1026
So it looks like the VM is only capable of using 512 megs of ram during this issue.
Question, if the -xms and -xmx parameters were not set correctly, would it keep the VM from using all of its available memory? Am I wrong to think that the VM should have been able to use more memory?
Let me know.
Thank you,
Matthew
Kaizen!