From 57aec48050e1b435f1970b5f483bf47a143b749e Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Mon, 10 Oct 2011 11:04:28 +0200 Subject: [PATCH] dom0/qmemman: alloc at least 100MB for domain If domain has less than 100MB it will cause OOM very soon - this isn't enough for non-swappable data... --- dom0/qmemman/qmemman_algo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom0/qmemman/qmemman_algo.py b/dom0/qmemman/qmemman_algo.py index 5f01abf2..f0d3d95c 100755 --- a/dom0/qmemman/qmemman_algo.py +++ b/dom0/qmemman/qmemman_algo.py @@ -58,10 +58,11 @@ def refresh_meminfo_for_domain(domain, untrusted_xenstore_key): def prefmem(domain): CACHE_FACTOR = 1.3 + MIN_PREFMEM = 100*1024*1024 #dom0 is special, as it must have large cache, for vbds. Thus, give it a special boost if domain.id == '0': return min(domain.mem_used*CACHE_FACTOR + 350*1024*1024, domain.memory_maximum) - return min(domain.mem_used*CACHE_FACTOR, domain.memory_maximum) + return max(min(domain.mem_used*CACHE_FACTOR, domain.memory_maximum), MIN_PREFMEM) def memory_needed(domain): #do not change