Skip to content

Measuring the Memory Used by the YaST Installer

Ladislav Slezák edited this page Jul 22, 2016 · 2 revisions

The Memory Consumption

Low memory consumption is very important for the installer because the initial installation system runs in a RAM disk (the files occupy the RAM space not a disk space) and the swap space is not used yet.

If the memory runs out and the installer or the tools still need more than the kernel OOM killer is started and kills some process to free some memory.

However killing a process usually results in an installer crash.

Measuring the Used Memory

The memory can be consumed by different ways, the measuring needs to be done accordingly.

Overall Memory Usage

You can run free (or free -m, free -h variants to have more readable output) to get the overall system memory usage.

The Memory Used by the Processes

The running processes obviously need some memory. The easiest way is run something like ps aux to see the memory used.

But actually reading the report is a bit tricky. The VSZ memory is a virtual memory allocated by the process, but it does not mean that it is actually all physically used...

The RSS is the resident part of the memory, the physical memory used. So usually this value is the most important.

The Memory Used by Ruby Part of the Installer

Ruby since version 2.1 supports tracking the objects. You can read more details in this document.

You can dump all Ruby objects into a file with details like the memory size, the place in the code which created the object, etc...

You can simply analyze the dump and collect some statistics like the largest objects, the code which creates most objects...

An example script and a dump from an YaST installation is available here.

Details of the Process Memory

The details of the used memory can be found in the /proc/<PID>/smaps file. For the YaST installer find the PID for the y2base process (e.g. ps -ao pid,command | grep y2base).

The Memory Used by the Files in the RAM Disk

During installation the installer obviously cannot run from a physical disk (the system is not installed to disk yet), it needs to run from a RAM disk. So all files in under the root (/) directory occupy the RAM space instead of a disk space.

To find the used disk space use the usual disk tools like df or du.

Another possibility is to check the size of the root image in the installation-images package. This file is a squashfs image which is loaded in mounted by linuxrc.

Packages Included in the Inst-sys

You can find the list of packages included in the inst-sys in the /.packages.root file. The file also contains the dependencies which caused including the packages (but only one for a package, if a package is required by several packages only one is listed).

Note: The inst-sys may include only a part of a package, if a package is listed in the .packages.root file it does not mean that all files from the package are included in the inst-sys.