Roberto Lo Giacco
2008-Jul-17 16:28 UTC
[Xen-users] Java memory allocation in guest domain with mem and max-mem properties
Hi, I''ve tried to search the list archives but I didn''t found anything about this and I''m experiencing some problems I need to solve quickly so here follows my question and related doubts. * The configuration I''ve an 8GB equipped with 2 dual core xeon cpus server running CentOS 5.1 (x64) and xen 3.0.3-41.el5 on kernel 2.6.18-53 I''m running 4 DomU each one with mem = 512M and max-mem=2GB Each of my DomU runs a java application (JBoss 4.2.2-GA) using the Sun JDK 1.5.0.14 with options to grow java heap size from 256M to 1G on demand * The problem My JVM runs out of memory without balloing the Xen memory, or at least this is what I think I''m experiencing. If I run free in the DomU or xm top in the Dom0 I see my DomUs memory standing still at 512M, if I run top in the DomU I see the java process running with 300M on memory and 700M on swap space (which is something I want to avoid and let the app run in memory) and in some occasions going in OutOfMemoryError without seeing the xen memory balloing out * The question Have I missed something (I''m quite new to xen) in my configuration files, like using mem-min and mem-max instead of mem and mem-max? Anyone out there has already encountered this behavior and solved it? Does this error depends on the used JVM or is there any solution which is not just "set your DomU memory to a fixed value of 2GB" (btw, this is the only solution which comes to me)? Thank you in advance for your patience guys (and ladies, if any!) -- Roberto Lo Giacco _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Robert Read
2008-Jul-17 16:58 UTC
Re: [Xen-users] Java memory allocation in guest domain with mem and max-mem properties
On Jul 17, 2008, at 09:28 , Roberto Lo Giacco wrote:> > * The question > > Have I missed something (I''m quite new to xen) in my configuration > files, like using mem-min and mem-max instead of mem and mem-max? > Anyone out there has already encountered this behavior and solved it? > Does this error depends on the used JVM or is there any solution which > is not just "set your DomU memory to a fixed value of 2GB" (btw, this > is the only solution which comes to me)? > > Thank you in advance for your patience guys (and ladies, if any!)It''s possible this has be implemented in more recent releases, but 3.0 does not support guest autoballooning. In other words, you''ll need to track guest memory and add more manually, at least in 3.0. Automating this shouldn''t be too difficult, though, so if this hasn''t been done yet in xen 3.3 then we really should find some volunteers to take this on... robert _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2008-Jul-17 18:11 UTC
Re: [Xen-users] Java memory allocation in guest domain with mem and max-mem properties
On Thursday 17 July 2008, Robert Read wrote:> On Jul 17, 2008, at 09:28 , Roberto Lo Giacco wrote: > > * The question > > > > Have I missed something (I''m quite new to xen) in my configuration > > files, like using mem-min and mem-max instead of mem and mem-max? > > Anyone out there has already encountered this behavior and solved it? > > Does this error depends on the used JVM or is there any solution which > > is not just "set your DomU memory to a fixed value of 2GB" (btw, this > > is the only solution which comes to me)? > > > > Thank you in advance for your patience guys (and ladies, if any!) > > It''s possible this has be implemented in more recent releases, but 3.0 > does not support > guest autoballooning. In other words, you''ll need to track guest > memory and add more manually, at least in 3.0. > > Automating this shouldn''t be too difficult, though, so if this hasn''t > been done yet in xen 3.3 then we really should find some volunteers to > take this on...It''s still the case that guests will not balloon themselves "on demand". mem-max is a limit on how large the domain can grow but it won''t grow unless you tell it to. Also, you can''t normally grow a domain beyond its initial allocation unless you pass "mem=<foo>" on its kernel command-line to tell it how big its memory might get. You can of course start a domain large and then balloon it down to normal operating size. There have been patches floated for automatically dynamically reszing domains. Dan Magenheimer has posted some to the xen-devel list in the last few months - those threads would be worth looking at for anyone wishing to get some functionality like this into mainline or just to try it out. This is all due to the fact that (unlike VMware and many other VMMs) Xen opts not to swap domains but leave it up to them to implement a sensible swapping policy. This strategy would be usefully complemented by an "autoballooning" feature for domUs that could redistribute memory when required and it''s been on the roadmap for a long time. I hope that helps. Cheers, Mark -- Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Reasonably Related Threads
- [PATCH] xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem
- auto-ballooning crashing Dom0?
- [PATCH] xl: extend autoballoon xl.conf option with an "auto" option
- Disable memory balloon in dom0
- [PATCH] libxl - fix a variable underflow in libxl_wait_for_free_memory