I own an 8GB RAM Dell XPS13 9343; the amount of RAM is the biggest pain of this computer, it's soldered on mainboard. Despite the CPU supporting more RAM, even resoldering bigger ones with firmware modification is not an option due to the mainboard design. So make this computer still useful, I replaced M.2 SATA disk with faster M.2 NVMe one and added two extra swapfiles.
My standard config for internet browsing is 8GM RAM + 8GM swap partition, while on-demand I have two extra swapfiles residing on ext4/(root). This gives me in total 32GB swap. It's also worth mentioning that all filesystems including all swaps reside on encrypted LUKS + LVM. This is intentional as I don't want my RAM to be exposed when the computer is turned off.
This setup generally does work; when I enable a lot of memory hungry (usually Java + browser based content, occasionally a single virtual machine), I just turn on both swapfiles and after all needed apps are launched the total load doesn't exceed 20% CPU and total disk I/O doesn't exceed 20M/s.
Now the question part: whole solution occasionally - once a week, when I use memory intensive task few times a week becomes unstable/unreliable. Sometimes it reboots - not sure if it's kernel panic of some hardware issue but graphic card buffers gets corrupted for less than a second then computer restarts. I'm unable to use kdump-tools to debug kernel panic as thanks to Dell's firmware my UEFI doesn't recognize the NVMe disk and I need to put rEFInd on USB only for the boot stage. The second issue is that occasionally when CPU loads increase and I play music in the background, it starts to stutter along with my X11.
While some parts are expected as this is not decent hardware I'm worried that this load can affect audio buffers and so I'm looking for a way to make this more stable. IMHO the load should affect only userspace apps without making those system-wide problems.
I'm using Ubuntu on it and I'm aware there exists a low-latency kernel but wondering if I can first test some lighter solution which can be switched back and forth at runtime. Like things related to amount of file descriptors or assigning some priorities via cgroups?