Beorn_Bear
Posts: 109
Joined: Tue Feb 27, 2018 6:04 pm

Zram and/or swap file for Raspberry Pi 4 recommended??

Sat Jul 20, 2019 5:24 pm

What would you recommend for Zram and/or swap files?! Would it work better on a usb flash key?! Is there significant improvement on performance on a Raspberry 4?!

wildfire
Posts: 570
Joined: Sat Sep 03, 2016 10:39 am
Location: Dundee, Scotland

Re: Zram and/or swap file for Raspberry Pi 4 recommended??

Sat Jul 20, 2019 5:30 pm

Only lightly used at the moment but my 4Gb is not using swap at all, so my answer is leave well alone.

It may help if you specify how much RAM you have,
E8 85 A2 64 C9 64 81 94 64 81 95 64 89 84 89 96 A3
Still NF Shirls

Andyroo

Re: Zram and/or swap file for Raspberry Pi 4 recommended??

Sat Jul 20, 2019 5:34 pm

Folk have ran Zram on 3B+ here before and seen advantages.
Others have run a decent swap file on HDD / SSD and seen advantages

I would not run a swap file of USB stick or SD card due to wear levelling.

Given the cost of these boxes I would say if you have lots of apps running and eating memory, look to off load some onto another Pi :lol:

Just keep an eye on memory use - if you need it move to HDD / SSD and set up a decent sized one.

RonR
Posts: 742
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Zram and/or swap file for Raspberry Pi 4 recommended??

Sat Jul 20, 2019 5:46 pm

The attached scripts will allow you to quickly install/remove zram so you can evaluate it yourself.
Attachments
zram.zip
(1.07 KiB) Downloaded 76 times

pik33
Posts: 184
Joined: Thu Sep 10, 2015 4:26 pm

Re: Zram and/or swap file for Raspberry Pi 4 recommended??

Sat Jul 20, 2019 6:01 pm

I made a real swap partition for RPi4/4GB and it seems it is not used at all. The amount of free ram is huge even when a lot of internet pages are open. I uninstalled dphys-swapfile. The swap partition sits there and waits for ram eating tasks.

Code: Select all

              total        used        free      shared  buff/cache   available
Mem:        3999788      373568     3072864      102876      553356     3399576
Swap:       4194300           0     4194300
This is what it looks like with Chromium and RPi forum is open (I am posting from this Pi right now)

Musketeer
Posts: 152
Joined: Fri Feb 12, 2016 1:23 pm
Location: CZ

Re: Zram and/or swap file for Raspberry Pi 4 recommended??

Sat Jul 20, 2019 7:34 pm

There are people who have /tmp + /log or some other dirs mapped to RAM so it s definitely much useful trick then temp file...
Linux is like woman - both wants 180 % of your time...
You want speed Java 9.8x? Throw it out of some Window(s)!
My girlfriend is terribly unmature - she always sinks my boats in bathtub!

Return to “General discussion”