06-17-2020, 01:26 PM
(06-17-2020, 11:26 AM)Surehand53 Wrote:I used a bit different approach. My setup involves three files:(03-20-2020, 09:34 PM)moonwalkers Wrote: This basically puts the amount of memory used at about 9.5GiB (used + DATA - TOTAL), that's on a system with only ~3.7GiB RAM available!
Code:$ free -h; zramctl
total used free shared buff/cache available
Mem: 3.7Gi 3.5Gi 34Mi 84Mi 224Mi 114Mi
Swap: 14Gi 7.9Gi 7.0Gi
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle 14.8G 7.9G 1.9G 1.9G 6 [SWAP]
And the system is still surprisingly responsive for a low-power CPU.
Hi moonwalkers.
After your enthusiastic description I thought I try zram.
I have used this guide to set it up and it seems to work
https://www.techrapid.uk/2017/04/create-...linux.html
Is that similar to what you are using ?
And more crucially, How do I get to the 9 Gi free mem. If I understand correctly I have 6 Gi from my guide ?
Code:
$ cat /etc/modules-load.d/zram.conf
zram
$ cat /etc/udev/rules.d/10-zram.rules
KERNEL=="zram0", SUBSYSTEM=="block", ACTION=="add", ATTR{initstate}=="0", PROGRAM="/bin/sh -c 'echo $(($(LANG=C free -k | sed -nr s/^Mem:\ *\([0-9]+\)\ +.*$/\\1/p)*4))KiB'", ATTR{disksize}="$result", RUN+="/sbin/mkswap $env{DEVNAME}",TAG+="systemd"
$ cat /etc/fstab
LABEL=pine-RootFS / ext4 defaults,relatime 0 1
PARTLABEL=pine-Boot /boot ext4 defaults,relatime 0 2
PARTLABEL=pine-EFI /boot/efi vfat defaults,relatime 0 2
/dev/zram0 none swap sw 0 0
As to the "free memory" - just to clarify, you'll never get more free memory than what your PBP physically has, but zram can allow you to put more stuff in that memory by compressing that stuff. That means if the apps you run fill their memory pages with patterns that are not easily compressible by the lzo or lz4 algorithm you will run out of RAM even if you have "plenty free space" in your zram swap, your system will slow down and may even have OOM killer going on a hunt. But if you run apps that fill memory with patterns that can be easily compressed then you will achieve the result I've described above and maybe even better. The reason I use high zram to RAM ratio is because in my experience the system behavior is similar regardless of which way the system runs out of memory, swap space on zram first or RAM to allocate for zram first, but with bigger zram I get more leeway in case the data is well compressible (seems to be the case for browsing).
This message was created with 100% recycled electrons