[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Doubt on XEN memory management: please clarify

On 14 April 2012 20:57, Simon Hobson <linux@xxxxxxxxxxxxxxxx> wrote:

Hello Simon,
thanks for replying.

> The default is that when you boot, all the system RAM (less a bit used by
> Xen itself) will be 'available' to Dom0. As you start guests, then Dom0 will
> balloon down it's memory availability to free memory for the guest. This all
> works fine, and as long as you never force memory down too low then Dom0
> won't complain - you can set a minimum below which Dom0 will not balloon and
> it would be a good idea to tune this to your requirements.
Good. This is clear to me now.

> Now, for a couple of reasons this isn't ideal. The main reason is that
> certain buffers and structures used to keep track of "stuff" are sized at
> boot time based on the amount of memory available. So in your case, you
> start with 8G of RAM but potentially balloon down to as little as 1/4G
> (256M) - just 1/32 of the size. So you now have a system running in a small
> amount of RAM but with buffers and structures sized for a lot of RAM (about
> 32 times what it actually has available in this case).
This still confuses me a little bit. I don't know if the memory issue
I've reported
in my previous message makes things hard to be understood by me, but what
I can see when I use dom0_mem=1024M, is that the dom0 has 1024MB of RAM
for itself and the 'free' command shows that I only have 600MB of total RAM.
If I'm not wrong, I should see about 7GB of free RAM, since 1GB is assigned to
dom0. Now, if things would work fine, I should have 1GB for the dom0, that could
potentially balloon down for the reason you said above, and about 7GB for every
domU I am running.
Now, since I only have 600MB RAM free, this would mean that if I start a domU,
this would completely freeze my system, due to memory exhaustion. Isn't it?
Or the memory is simply hidden, and I can start whatever domU I want?

To be honest I think that the last option shouldn't be true, since I notice a

> Lastly, these changes in memory allocation will (or may) affect performance
> in some areas - giving a variable system performance depending on how many
> guests are running and how much RAM they use.

> So it's a good idea to specify how much memory to give to Dom0. It will then
> size things to suit (which in itself will reduce it's memory footprint). You
> can still balloon between high and low limits, or you can set a fixed
> allocation and have deterministic performance and minimum memory usage.
> 8G isn't a good choise - see above about sizing of buffers and structures.
OK. 1024M should be ok, in my case apart of the problem caused by the
memory issue mentioned above.

> 256M may or may not be enough - only you can only determine that for your
> setup, it depends on what is running on the system. If you run just the bare
> minimum of software/services on Dom0 then it may well be enough, but if you
> run other things (particularly memory hungry programs) it might not be
> enough.
Yes, actually if I run KDE, this sucks a lot. You may wonder why I run KDE on
a dom0, but I usually use this installation for testing purposes and I
need X to run
graphical sessions of domUs.

> You need to pick a value (not too low, try starting at 512M and work
> down) and then look at how the system is running - look at how much memory
> is used for different things (cat /proc/memory) and particularly if it is
> swapping (very bad for performance).
> Normally, you don't tend to do much in Dom0, so not having large caches
> isn't really an issue (it just delays things when stuff has to read from
> disk instead of cache when you issue a command) as long as all the stuff
> that's running "all the time" or "frequently" can stay in RAM.
Thank you so much for the explanation.

I would ask you if you know some book where all this memory issue is explained.
It would be great to see some scheme, to understand in deep the memory
I don't know if The definitive guide to the XEN hypervisor of Devid
Chisnall would
deal about this, and is good for the new XEN support into the vanilla kernel.
I don't know how many things have changed with respect to the "old" xen-sources.



Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.