The size of an operating system stems from the packages it comprised off of and the ones it contains.
Note that some packages may be included with a certain OS installation yet they may not be a necessity for it to operate properly.
For instance, one OS can ship with 2 different text editors by default, these packages, although contained within the OS itself, aren’t mandatory for it to run.
Nonetheless, as mentioned in the former part of this series, we will consider the packages that come by default with each OS as part of its size.
So for instance, in our case each OS is comprised of a kernel / base system, process management system (also known as init) and a package manager.
These are some bare essentials which none of the mentioned OSs can do without.
The reason we’re taking note specifically of these components is for they are unique key parts of each system and also since they’re comparable – they exists in each system.
The following images shows the amount of disk space each OS occupies when their essential components are extracted from source code into one directory that represents them:
- The actual size of each OS in real case scenario would probably be a lot different than the one depicted by the images, those were intentionally taken this way in order to simulate a lab conditions test environment. Nonetheless, they may be referenced as a rough representations.
- Do consider that the above are representing only the main components of each OS whereas their dependencies are excluded.
- As mentioned before, unlike Linux, FreeBSD is not only a kernel but an entire “base system”, a fact which may account for the relatively large gap it has over the two Linuxs.
So as you can see, by default, considering only some of the basic components each system has, FreeBSD tends to be the largest of the three while the margin between Gentoo and Arch-Linux may be considered negligible.
Yet there’s another aspect we must consider when assessing source based distributions such as Gentoo or FreeBSD:
Since both encourage the user to compile packages from source, the user is given the chance to change packages inner configuration (use-flags) which may in turn result in less or more dependencies being pulled / required by a package, ultimately this may lead to a lighter / heavier system.
Generally, binary based distributions such as Arch in this case, usually has the tendency to include most of the use-flags a package contains, that’s in order not to leave any functionality a user might need behind.
So perhaps, at the end of it, this is were the key difference in our comparison lies at.
Based on the above given fact, here are some RAM usage data I collected while having those systems installed on virtual machine – each run a minimal KDE environment installed from each OS stable branch:
- The big difference between both Linuxs and FreeBSD may be partially explained by the different memory allocation methods they use and also because FreeBSD runs a Linux compatibility layer to provide binary compatibility with Linux.
- The Gentoo system in the image above was built with a minimal amount of specific customization and use-flags.
- The FreeBSD system was built using PKG package manager and not by compiling packages straight from source since it is faster, yet admittedly, it probably takes more RAM this way.
What can be deduced?
Among the three, Gentoo Linux can be made to consume the least amount of disk space and RAM out of the box.
Yet this virtue doesn’t come without a price, depending on your hardware specifications, building a Gentoo system optimized to your needs may take hours and in some cases even days to accomplish, not to mention the steep learning curve that might accompany it.
In general, FreeBSD is the more robust out of the three since it brings more to the table than its Linux counterparts, that is because it includes a complete base system, i.e tools that help manage and maintain the system right from the start.
Of curse, the result is that FreeBSD is also consuming the largest amounts of space and RAM by default.
Among the three, Arch is walking the middle road while combining advantages from both worlds – fast to install and pretty lightweight as well, yet out of the box at least – it isn’t granularly optimized as Gentoo nor robust as FreeBSD.
Despite the above, remember that eventually, each of these fantastic systems can be configured differently and the outcome may lead to completely different results than the aforementioned.
Moreover, for many modern machines disk space and RAM usage are becoming less of an issue that what they used to be in the past. Hence, in the next chapters we’ll explore other aspects of each OS.