Fixing installer memory use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With F17, a virtual machine with 256MB RAM will hang trying to start
anaconda. Sometimes there's OOM-kill messages, sometimes not, but RAM is
definitely the problem.


== Solution ==

Now, we know that the initramfs is using ~81MB RAM. We can reduce that to
~17M by doing two things:

  1) Remove kernel modules & firmware (they're already in the runtime)
  2) Compress everything we're not going to use during the install

This isn't quite enough though. Once you do that you can start the GUI,
but if you select any language other than English the install crashes.
(localedef runs out of RAM and fails, which makes anaconda unable to switch
languages)

So we need to go back to using the pregenerated locale files. This
increases runtime size by ~6MB (~4%) but the installer will actually run
and complete successfully. Plus it lets us remove code, which is always
nice.


== Implementation ==

There's two sets of patches here - two for lorax and three for anaconda.

The anaconda patches add an anaconda-cleanup-initramfs.service that does
the two things mentioned above, and then removes all the code that runs
'localedef'.

The lorax patches remove localedef and keep the existing locale files,
and then keep the dracut-shutdown.service (and its dependencies) so we can
unpack the compressed initramfs at shutdown time (so reboot still works
right).


== Notes ==

I have built images (based on F17) locally and confirmed that, with these
patches, it's possible to complete an install (from boot.iso) on a virtual
machine with 256MB RAM.

The compression takes about 3.6 seconds on my test VM (~2.6GHz CPU). It has
no noticeable impact on startup speed; it happens in the background while
anaconda is starting. (Anaconda startup is mostly I/O-bound, but
compression is CPU-bound, so they complement each other.)

Using xz for compression would make the compressed initramfs ~4MB smaller,
but it takes ~45s (!) and uses 100MB RAM (!!), so that's not viable.

Removing unused languages from locale-archive doesn't change its file size
any (!?), so that part might be unnecessary. Further testing would be
helpful.


Comments and questions are welcome.

-w

Anaconda diffstat:
 anaconda                                        |    6 ----
 data/systemd/Makefile.am                        |   12 +++++++-
 data/systemd/anaconda-cleanup-initramfs         |   35 +++++++++++++++++++++++
 data/systemd/anaconda-cleanup-initramfs.service |   11 +++++++
 pyanaconda/iw/language_gui.py                   |    1 -
 pyanaconda/kickstart.py                         |    1 -
 pyanaconda/language.py                          |   18 ------------
 pyanaconda/textw/language_text.py               |    1 -
 8 files changed, 57 insertions(+), 28 deletions(-)

Lorax diffstat:
 share/runtime-cleanup.tmpl |   20 +++++++++++++-------
 share/runtime-install.tmpl |    2 ++
 2 files changed, 15 insertions(+), 7 deletions(-)

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux