I am trying to allow domains'' memory allocation to be altered by using both the "memory" and "maxmem" options in my config files (i.e. set maxmem to some large value to allow the domain to be resized up to that amount, and memory to set the initial allocation). However I appear to lose potentially quite a large chunk of memory as I use a larger "maxmem" option. For instance if I use memory=512, as I use a higher value for maxmem, I lose more memory according to "free" in the guest. I lose about 200MB (nearly half the memory!) if I have a maxmem of 8GB and even more when it is higher. I have looked around and couldn''t find any mention of maxmem taking a chunk out of the memory by design. Would anybody be able to shed any light on this? I have tested this with both Xen 4.0.1 and 4.1.2, and Kernel version 2.6.32 Phil.
I am trying to allow domains'' memory allocation to be altered by using both the "memory" and "maxmem" options in my config files (i.e. set maxmem to some large value to allow the domain to be resized up to that amount, and memory to set the initial allocation). However I appear to lose potentially quite a large chunk of memory as I use a larger "maxmem" option. For instance if I use memory=512, as I use a higher value for maxmem, I lose more memory according to "free" in the guest. I lose about 200MB (nearly half the memory!) if I have a maxmem of 8GB and even more when it is higher. I have looked around and couldn''t find any mention of maxmem taking a chunk out of the memory by design. Would anybody be able to shed any light on this? I have tested this with both Xen 4.0.1 and 4.1.2, and Kernel version 2.6.32 Phil. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On Tue, 2012-05-15 at 12:50 +0100, Phil Evans wrote:> I am trying to allow domains'' memory allocation to be altered by using > both the "memory" and "maxmem" options in my config files (i.e. set > maxmem to some large value to allow the domain to be resized up to > that amount, and memory to set the initial allocation). > > However I appear to lose potentially quite a large chunk of memory as > I use a larger "maxmem" option. For instance if I use memory=512, as > I use a higher value for maxmem, I lose more memory according to > "free" in the guest. I lose about 200MB (nearly half the memory!) if > I have a maxmem of 8GB and even more when it is higher. > > I have looked around and couldn''t find any mention of maxmem taking a > chunk out of the memory by design. Would anybody be able to shed any > light on this?When the guest kernel starts up it needs to size various internal data structures (e.g. the frame table, various page table data structures etc) according to the maximum size it expects ever to see (so maxmem). There is a per-guest limit onto how small you can make memory compared to maxmem. More modern pvops Linux kernels support memory hotplug which does away with some of this limitation, although I''m not sure if tools support exists. Ian.
Hello Phil, On Tuesday 15 May 2012 13:42:34 Phil Evans wrote:> I am trying to allow domains'' memory allocation to be altered by using > both the "memory" and "maxmem" options in my config files (i.e. set > maxmem to some large value to allow the domain to be resized up to that > amount, and memory to set the initial allocation). > > However I appear to lose potentially quite a large chunk of memory as I > use a larger "maxmem" option. For instance if I use memory=512, as I > use a higher value for maxmem, I lose more memory according to "free" in > the guest. I lose about 200MB (nearly half the memory!) if I have a > maxmem of 8GB and even more when it is higher. > > I have looked around and couldn''t find any mention of maxmem taking a > chunk out of the memory by design. Would anybody be able to shed any > light on this?At least from the Linux kernel I know that it needs memory to manage the memory itself. The data structures are scaled accoring to the maximum size, that is they are allocated at the very start to manange all that potential memory. The actual memory is then reduced using ballooning, which doesn''t affect those structures, since it only marks pages as unavailable to the OS, but those pages are still seen and managed by the OS, so the structure can''t shrink. Same''s probably with Xen. Sincerely Philipp -- Philipp Hahn Open Source Software Engineer hahn@univention.de Univention GmbH be open. fon: +49 421 22 232- 0 Mary-Somerville-Str.1 D-28359 Bremen fax: +49 421 22 232-99 http://www.univention.de/ _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users