Portal Home > Knowledgebase > Articles Database > Xen not able to free RAM..


Xen not able to free RAM..




Posted by devonblzx, 03-06-2010, 11:41 AM
Hello, I'm not as experienced with Xen as I am with OpenVZ but we have an 8GB RAM server and had ~7400MB used. I destroyed a 384MB VPS a few days ago so now it has about ~7000MB used. Now when I try to create a 640MB VPS it states this: Error: Not enough memory is available, and dom0 cannot be shrunk any further In xm list it shows dom0 is allocated 539MB. This usually changes depending on how many servers I have running. However it should be closer to 1GB since I only have 7GB allocated to VMs. Anyone know why the RAM doesn't seem to be updating?

Posted by UNIXy, 03-06-2010, 12:02 PM
It's very possible dom0 can't free up much RAM as it's using it internally. Here's how you can find out how much RAM is available to your domU's: That's the allocatable amount. I'm particular it's below 640MB. Regards Joe / UNIXY

Posted by devonblzx, 03-06-2010, 12:53 PM
Hello, total_memory : 8115 free_memory : 404 But when I count up the RAM used from xm list it is equal to 7040MB. So what is happening to the other 670MB?

Posted by devonblzx, 03-06-2010, 01:01 PM
Nevermind, I think I understand now. The dom0 is using 539MB, then the xm info shows what I can actually allocate to a virtual server. Does 539MB seem high for a dom0 to be using or about normal? How much do you usually allocate? Thanks!

Posted by UNIXy, 03-06-2010, 01:05 PM
Yep, you got it. Run top and order by memory usage (press upper case M to start sorting). Copy/paste the top ten processes so we can take a look. Regards Joe / UNIXY

Posted by devonblzx, 03-06-2010, 01:12 PM
ps output of 3133: root 3133 1.5 7.0 262304 39172 ? Sl Jan11 1204:23 \_ python /usr/lib/xen-3.2-1/bin/xend start Seems like the virtual memory is high but not really the RAM itself. I think I have to work on configuring the dom0 better.

Posted by PCS-Chris, 03-06-2010, 01:30 PM
You should really seperate Dom0 memory from the memory available to create DomU's with, by setting a fixed amount of memory for dom0 in /etc/xen/xend-config.sxp Not only will this enable you to have accurate readings of the free memory all the time, but it also helps considerabley with stability of the host.

Posted by UNIXy, 03-06-2010, 01:35 PM
VIRT stands for Virtual Image (not virtual memory). What it means is that it not only includes what xend/python is consuming in terms of code and data but also the amount of memory the shared libraries used by python/xend are consuming. Try /proc/3133/maps and see if there are superfluous libs there. Regards Joe / UNIXY Last edited by UNIXy; 03-06-2010 at 01:45 PM.

Posted by UNIXy, 03-06-2010, 01:37 PM
It's always good to set a limit but one has to be careful not to starve dom0. It's the heart of Xen. Regards Joe / UNIXY

Posted by devonblzx, 03-06-2010, 01:41 PM
Hello, Thanks for the advice, we have dom0-min-mem 196 in xend-config.sxp and dom_mem=384M in the grub.conf but it seems it raised it to 539M anyways. Is there another setting I should use in xend-config?

Posted by PCS-Chris, 03-06-2010, 02:22 PM
I would suggest something higher, how much you need depends on how much RAM the host has, how many VPS you are running and whether its Paravirt or HVM, or both. As a starting point I use 256MB for each 4GB of RAM in a system. You can also disable Dom0 from balooning and taking additional memory in /etc/xen/xend-config.sxp While the concept of balooning is good so that Dom0 is not "starved" of memory, it can actually lead to instability after the host has been up a considerable amount of time (from experience), and you may find xend bugs out and errors when you try to issue any command.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Jack Pot Host (Views: 671)


Language: