diff options
| author | Ales Kozumplik <akozumpl@redhat.com> | 2010-05-05 11:00:59 +0200 |
|---|---|---|
| committer | Ales Kozumplik <akozumpl@redhat.com> | 2010-05-06 14:57:11 +0200 |
| commit | fbe24fe21350eec043d3f8ad41c1908b0878114a (patch) | |
| tree | ca170e2762d32ac2b01dfc3c92c2f3a04846bb88 | |
| parent | 5c8be71aab71654c29df8a0950372c41e8a47aad (diff) | |
memory: increase the RAM limits, check for URL installs (#549653).
Due to higher memory consumption of LVM, kernel, anaconda and other
running processes in general our current memory limits are insufficient
and the increase is neccessary. I am also introducing additional check for
URL installs which require another 108 MB from the ramdisk, no need to
penalize other install methods.
This is the current memory budget:
- unpacked initrd takes 63 MB
- running processes (anaconda, loader, udev, nm): 67 MB (estimate)
- peak LVM memory consumption: up to additional 56 MB
- with URL install install.img takes additional: 108 MB
- memory requriements of X additional: 256 MB (estimate)
Currently we always expect there will be calls to lvm (though we could do
another memory check just at the moment where the necessity arises). All
of the estimates are on the upper bound, still I am running into OOM
easily with text install+http stage2+lvm detection with the old limits.
| -rwxr-xr-x | anaconda | 37 | ||||
| -rw-r--r-- | isys/isys.c | 1 | ||||
| -rw-r--r-- | isys/isys.h | 5 | ||||
| -rwxr-xr-x | isys/isys.py | 1 |
4 files changed, 34 insertions, 10 deletions
@@ -349,24 +349,42 @@ def runVNC(): sys.stdin.readline() iutil.execConsole() -def checkMemory(anaconda): - if iutil.memInstalled() < isys.MIN_RAM: - from snack import SnackScreen, ButtonChoiceWindow +def within_available_memory(needed_ram): + # kernel binary code estimate that is + # not reported in MemTotal by /proc/meminfo: + epsilon = 15360 # 15 MB + return needed_ram < (iutil.memInstalled() + epsilon) + +def check_memory(anaconda, opts, display_mode=None): + + if not display_mode: + display_mode = anaconda.displayMode + + extra_ram = 0 + reason = '' + if opts.stage2.startswith(('http', 'ftp', '@')): + extra_ram += isys.URL_INSTALL_EXTRA_RAM + reason = " using this install method" + needed_ram = isys.MIN_RAM + extra_ram + if not within_available_memory(needed_ram): + from snack import SnackScreen, ButtonChoiceWindow screen = SnackScreen() ButtonChoiceWindow(screen, _('Fatal Error'), _('You do not have enough RAM to install %s ' - 'on this machine.\n' + 'on this machine%s.\n' '\n' 'Press <return> to reboot your system.\n') - %(product.productName,), + %(product.productName, reason), buttons = (_("OK"),)) screen.finish() sys.exit(0) # override display mode if machine cannot nicely run X - if not flags.usevnc: - if anaconda.displayMode not in ('t', 'c') and iutil.memInstalled() < isys.MIN_GUI_RAM: + if display_mode not in ('t', 'c') and not flags.usevnc: + needed_ram = isys.MIN_GUI_RAM + extra_ram + + if not within_available_memory(needed_ram): complain = _("You do not have enough RAM to use the graphical " "installer.") if flags.livecdInstall: @@ -546,6 +564,9 @@ if __name__ == "__main__": (opts, args) = parseOptions() + # check memory, just the text mode for now: + check_memory(anaconda, opts, 't') + if opts.unsupportedMode: stdoutLog.error("Running anaconda in %s mode is no longer supported." % opts.unsupportedMode) sys.exit(0) @@ -741,7 +762,7 @@ if __name__ == "__main__": log.info("Display mode = %s" % anaconda.displayMode) log.info("Default encoding = %s " % sys.getdefaultencoding()) - checkMemory(anaconda) + check_memory(anaconda, opts) # # now determine if we're going to run in GUI or TUI mode diff --git a/isys/isys.c b/isys/isys.c index 6b49ba625..409170b29 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -313,6 +313,7 @@ void init_isys(void) { PyDict_SetItemString(d, "MIN_RAM", PyInt_FromLong(MIN_RAM)); PyDict_SetItemString(d, "MIN_GUI_RAM", PyInt_FromLong(MIN_GUI_RAM)); + PyDict_SetItemString(d, "URL_INSTALL_EXTRA_RAM", PyInt_FromLong(URL_INSTALL_EXTRA_RAM)); PyDict_SetItemString(d, "EARLY_SWAP_RAM", PyInt_FromLong(EARLY_SWAP_RAM)); } diff --git a/isys/isys.h b/isys/isys.h index 265dc7760..e3cb1fca5 100644 --- a/isys/isys.h +++ b/isys/isys.h @@ -20,8 +20,9 @@ #ifndef H_ISYS #define H_ISYS -#define MIN_RAM 131072 -#define MIN_GUI_RAM 393216 +#define MIN_RAM 262144 // 256 MB +#define MIN_GUI_RAM 524288 // 512 MB +#define URL_INSTALL_EXTRA_RAM 131072 // 128 MB #define EARLY_SWAP_RAM 524288 #define OUTPUT_TERMINAL "/dev/tty5" diff --git a/isys/isys.py b/isys/isys.py index b16c8e4e0..38eafe791 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -61,6 +61,7 @@ mountCount = {} MIN_RAM = _isys.MIN_RAM MIN_GUI_RAM = _isys.MIN_GUI_RAM +URL_INSTALL_EXTRA_RAM = _isys.URL_INSTALL_EXTRA_RAM EARLY_SWAP_RAM = _isys.EARLY_SWAP_RAM ## Get the amount of free space available under a directory path. |
