You shoshould always dedicate fixed amount of RAM for xen dom0.
This can be done by specifying "dom0_mem = 512 M" option for xen hypervisor (usually xen.gz) in grub. conf/menu. lst. this makes sure the initial size of memory allocated for dom0 is 512 MB (Replace with the amount of memory you want), and the rest of the Ram is available for other guests in xen hypervisor. see this grub. conf example for grub1:
Title xen 4.1.0/pv_ops dom0 kernel 2.6.32.36 root (hd0, 0) kernel/xen-4.0.gz dom0_mem = 512 M loglvl = All guest_loglvl = All module/vmlinuz-2.6.32.36 Ro root =/dev/sda2 console = hvc0 earlyprintk = xen nomodeset module/initrd-2.6.32.36.img
The next step is to configure xend to make sure dom0 memory is never ballooned down while starting new guests.
This can be done by editing/etc/xen/xend-config.sxp and modifying the "dom0-min-mem" option to (dom0-min-mem 512) and also change the "enable-dom0-ballooning" option to (enable-dom0-ballooning no ). these options will make sure xend never takes any memory away from dom0.
After making these changes to grub. conf and to xend-config.sxp, reboot the system. after reboot you will notice dom0 has only 512 MB of memory, and the rest of the Ram is available in xen hypervisor as a free memory. you can run "XM list" to verify the amount of memory dom0 has, and "XM Info" to verify the amount of free memory in xen hypervisor.