Downloading more RAM?!
You can sometimes encounter clickbaits like this, claiming that your computer will gain some (free) RAM capacity when you download some magical tool for free. And it then turns out that it's just some not-so-smart cleaner full of ads (in the better case). That's not what I mean.
My current personal laptop is now a bit older Asus Zenbook with AMD Ryzen 5 3500u paired with 8 GB RAM. It's a fine machine with enough performance except for one big issue. The RAM capacity available is approximately 5.7 GB which is far from good.
For daily use, it's not as limiting as it might seem. I'm running Ubuntu, and the user experience is snappy overall. With that said, there are use cases where the available amount is insufficient (e.g., compilation), and also, I paid for 8 gigs, so where are they?
The answer lies with the integrated GPU and something called UMA Buffer. That's a buffer whose size dictates how much RAM will be allocated to the integrated GPU exclusively. And as you probably guessed, my laptop has a UMA Buffer size set to whooping 2 GB. Therefore decreasing its size is the answer. But that's easier said than done. For some reason, Asus does not list UMA Buffer size option in the BIOS; therefore, there is no way how to change it. I started to explore other options.
The less invasive option was finding a way how to unlock hidden options in BIOS. Usually, there is some key combination that will show you options that are not available by default that allows changing system settings to a bigger degree. Unfortunately, until this day, I haven't found a key sequence that would work on Asus.
The more invasive way was to flash a modified BIOS with these options available. There are some tutorials online, but given that we're talking about BIOS, I could end up with a brick instead of a laptop, and that's not something I would like.
As it turned out, there was another option which I ran into recently. It's a tool called Smokeless_UMAF, and it should work on almost every AMD-based system.
The usage is pretty simple. You create a FAT32 USB drive, unzip the tool and then boot from the USB. That will get you into an old-BIOS-style menu where you can configure what you need. I decreased my UMA Buffer capacity to 512 MB, and now my system reports 7.2 GB of RAM available. That means I'm now able to compile the whole RoFI project without killing systemd's oomd service first, which is something I had to do before because the compilation process would get killed otherwise. Lovely, right?
The only negative is that the source code is not available, so you can't check what it does precisely (and, even more importantly, how). Anyway, I'm glad it worked without flashing of some modified BIOS. Additionally, it seems like I can now configure the CPU's TDP and other things, which opens some interesting paths to tweaking the whole system...