SSD's and caching - problematic?

Just about the only systems I ever see “thrash” into SWAP space are :

Oracle Database servers - Oracle RDBMS will start using SWAP after it starts…

Java server applets and Tomcat (java) applets running on “headless servers”… I think of Java server side as being a memory leak… i.e. Java doesn’t leak memory, it IS a memory leak :smiley: - and such systems will always go into swap usage…

Of that latter (or even both) - probably badly written code perhaps? Certainly doesn’t encourage efficient resource usage (although - I’m sure most Android app developers try to optimise for limited RAM scenarios - or the Android JAVA SDK / APIs takes care of that heavy lifting - not so with hobbled together legacy apps used by big corporates - they ship already chock full of bloat and “undocumented features”…

I don’t use swap on my Ubuntu Ryzen desktop system - it has 64 GB RAM (DDR4 - but not all run at the same speed) - I have swap disabled…

I still have swap enabled on my Ubuntu Ryzen ThinkPad - it has 16 GB RAM (DDR4) - and it does use swap - because like others mentioned previously : Chromium based browser(s) with many tabs open at once :smiley:

My main RPi system (Pi4 with 8 GB RAM) running bookworm (Raspbian 12) has zram configured…

Long and lengthy and interesting (IMHO) discussion here (It’s FOSS) about zram and zswap :

Worth investigating on systems with limited RAM.

I’m using zram swap config on my 8 GB RPi4

root@frambo:~# sudo swapon -s
Filename				Type		Size		Used		Priority
/var/swap                               file		204796		0		-2
/dev/zram0                              partition	9995384		179456

Only thing I don’t like about zram / zswap - it doesn’t have an entry in /etc/fstab… And I have to scratch my head trying to remember which file(s) it was configured in… e.g. with that Pi4 running Rasbpian Bookworm above - I setup zram so long ago - pretty much a case of “set it and forget it”…

@Rosika has successfully setup / configured zswap / zram on x86 Linux previously - I haven’t tried it other than on armhf and arm64 architectures…

4 Likes