For everyone that thinks this is magically "adding MORE RAM" to your RPI, all it does is it compresses "makes smaller" the stuff that is temporarily stored on the RAM by the CPU. This allows the CPU to put more stuff in RAM as now the space the the other stuff is smaller allowing you to put MORE in the same AMOUNT of RAM. The "side-effect" of this is that compression algorithms are not 100% efficient which means you will have to wait longer when the data on the RAM has to be decompressed then executed by the CPU.
Thanks! This short video is really helpful: didn't know about htop, conky, and zram. Got them both and with your config file it was no issue to get it running. Thanks again!
Works really well, totally worth it, if a pi is rich in CPU cycles and low on memory, this is a no brainner, Raspbian and Retropie, Kodi, will work better with this script.
Guys - before making comments - this is a ram compression scheme - it is NOT more RAM - you cannot GET more RAM for the Pi without getting an ultrafine soldering iron out - and I'm not even aware of anyone who has done that successfully. If you want more RAM there are plenty of alternative boards out there with 2GB RAM.
You install your own programs and scripts in /usr/local/bin, not in /usr/bin or in /bin. Those are reserved for Debian to install its own binaries from packages. if you do it, it could turn out to be a problem later.
I got it working! Figured out to use cursor to select line... got Conky going too and the first thing I noticed video plays without any lag with large display size definitely faster showing the 1Gig swap in Conky but temps up from around 38C to 45C and cpu usage about 50%, stop the video and it drops down to almost normal, was 0% at idle now lowest is about 5%. The trade off seems absolutely worth it considering the almost unwatchable slow buffering of video before, thanks really appreciate your Conky and Zram files and info!
I already miss being able to use xz compression as I used to with COMPCACHE. It's slower per operation, but operations are less frequent, and its compression is enough better than the rest that it's overall faster due to even less swapping to a slower device.
Extremely well done. I'm gonna give this a try on my kitchen-pi terminal. It's streaming video and doing Amazon Alexa at the same time so this might give it a bit of a "boost" . Thanks for the video. Eric
not possible it would suffer the optimization or minecraft java and for that matter java itself is horific you could run minecraft c++ so PE or win10 if you got the source code...
To be honest,i love raspi and all.but to 4gb you need an Ryzen microAtx and the full Rig Micro atx...it goest better and tiny as well as maybe the double of pi cases size. I was planing sell my fx8350 to get one full rig micro atx...but i didnt sold..i keep because i builded less than 1 month before..but it worth the size and money!
zram just creates compressed swap on RAM. This makes sense for this use but you're explaining it really badly. memory isn't "echo'd" into zram. Those echo lines in that script are setting the size of the devices by writing that size to /sys virtual files. It's also not really giving you an extra 1GB of RAM. I'm guessing the ZRAM devices are allocated dynamically, so they grow as they fill up, so your RAM will reduce as data is swapped out, and the amount of space you gain by swapping it out will really come down to the compressibility of the data.
I hope this works like you say it does. Because the Pi's could do with maybe another 2gb. The makers should have a look at upping the ram. I don't think any of us would mind a couple extra bucks for a 2+gb model.
Interesting stuff. So how much physical RAM does that swap pool actually take when it's full? How much slower is it? What kind of CPU usage should we expect?
Thanks. I did a PR for your ZRAM script to make it dynamic (so it supports not only Raspberry Pi but other SBCs and even PCs). I intend to utilize this on NEMS Linux (Nagios for Raspberry Pi).
Cool. Thanks for putting it together. I was looking for a decent way to maximize the RAM of the Pi 3 for NEMS, and this looks like a great way. The Pi community are die-hard and while I have many users who don't mind spending extra to get a more powerful SBC, this adds a bit of life to those aging Pi 3's. But now with this PR your script will work on any, so that's great. Thanks for the merge.
I love this. Thank you. I have been looking for ways to use the SD card to add more RAM. There is a way to do it on rooted android devices, so I figured that there surely was some way on this. This is close though and a great idea, I will check that out asap. Is this the pi OS?
Don, I am running Raspian with persistence from a USB, because my windows 10 hard drive crapped out on me on a Dell Desktop. I figured why not since all my other computers are Raspberry pi's or running some variant of Debian. This computer has two cpu's AMD Athlon(tm) II X2 250 Processors they are dual core (so together 4 cores). Regardless of the internal RAM and the SWAP space would enabling ZRAM increase performance. Its not slow by any means, but today a decent computer comes stock with 8gb RAM out of the box. This computer is right now the command and control for my small army of Pi's and other Linux boxes so every bit helps. If you could get back I would appreciate it, thanks.
Better way to increase the SWAP is edit dphys-swapfile: Before we can increase our Raspberry Pi’s swap file **sudo dphys-swapfile swapoff Modify the swap file configuration file **sudo nano /etc/dphys-swapfile Search and modify CONF_SWAPSIZE=100 For example, if we wanted to increase our swap size to 1GB, we would change that line to the following: **CONF_SWAPSIZE=1024 Next save the file by pressing CTRL + X, followed by Y, then ENTER. Now restart your device. **sudo reboot
Another efficient way to increase the SWAP is from dphys-swapfile: $ sudo nano /etc/dphys-swapfile # For 1GB CONF_SWAPFILE=1025 # For 2GB # CONF_SWAPFILE=2050
Your variable labeled "totalmem" needs to be rid of those depreciated backticks. Backticks for command substitution creates subshells which hinder performance of your bash scripts. Proper command substitution uses "$(commands here)" It should look like this: totalmem="$(free | grep -e '^Mem:' | awk '{print 2}')" Trust me, I am a bash guru. Brilliant video and very nice work.
This is great. I am using Raspian Jessie lite - command line only. Can i do the same configuration for command line? I am a java-nerd so all my rpi apps are in Java.
What is that thing you have the desktop not sure if you said carnky or something else either way can't find anything on the Internet for it or anything for it
This description is bad. However I loaded Conky and setup zram on my Pi4 today and the speed increase is noticeably faster. Trade off is the CPU is averaging higher load. Playing around with the disk space I notice my swap partition gets larger but does not seem to be used any longer? I have the 2GB model and leave only 256MB for the GPU share. My Pi4 is running well now. Looking forward to further testing.
You aren't increasing your RAM. You are compressing data that is stored in RAM so more is available in the virtual memory space. Overall RAM remains the same.
Hi my dear friend!!! First of all, congratulations for video!!! What software should I install to have this window with raspberry's informations on my desktop like you?
Sense this is for the raspberry pi 3. Would this work on the raspberry pi 4? I have one of the cm4 compute module 4 and it only haves 1gb. And needing more. Sense I don’t use monitors it’s all headless will this work?
Awesome video, Thanks! By the way, any ideas on how to make a portable display for raspberry pi and a powerbank? I was thinking on using phone batteries
i did something like that on my kali linux video ua-cam.com/video/6xXnUGR_e4E/v-deo.html using a powerbank that is normally used to charge phones with a 5" touchscreen display.
...no. A Swap partition is basically just using the Hard drive (or flash media, or whatever you have the OS installed on) as RAM... albeit at a much much much slower rate. So while yes this will give you "more ram" it probably won't have much of an effect, hell it might even slow the system down.
We used to call this "Virtual Memory," back in the '90s, before it became so commonplace, you didn't even get to choose how much of your HDD, etc. RAM you'll allow the OS to use, for it.
Need help please... cannot edit script “sudo nano /etc/rc.local”, terminal writes “/usr/bin/zram.sh &” to the beginning before the first “#” at top. How do I insert where you did?
Has this been at all tested on Retro Pi? and has it at all effected any of the emulators like the N64 etc etc? i'm currently using the Raspberry Pi 3 and was curious about it.
2gb is way more than any retro gaming console. the xbox 360 has 512mb of ram. RetroPi doesn't need more ram. Faster ram might help the emulator run better on PlayStation games but this mod will slow the ram as it has to compress and dump to storage. Don't bother with this for RetroPi it won't help
Hey man, I love your videos! You rock. I went to your site and got your conky config file, thank you for that. I was wondering if you could help us noobs get conky to boot up on start up. Thanks, RP
Your program is different in github as shown in the video. Which one do I need to follow ? Github or the one in this video for Zram. Im having Raspberry pi 3 b+
For whom which is trying to write the correct word of the lightweight free system monitor shown in the video, the name is "Conky". Who doesn't have English as a mother language is having trouble to find it.
What is 1024 representing? It is used to multiply 1/4 of the totalmem variable (if totalmem is not a variable, feel free to correct me, I don't know bash scripting). I initially assumed that it represented the Pi 3's RAM in MB, but in the zram script that debian has posted, it uses 1024 as a value like this: print $1*1024;
so at a complete guess could it be compressing 1gb of ram (1024mb) and keeping 1024mb uncompressed so the system didn't slow down due to compression overhead. The pagefile could be 2x ram (4096mb) and 1/4 of it would be 1024mb. This is my guess
Hi, I have a RPi3 with your installation of zRAM that works fine initially but the free RAM decreass over time until the Pi crashes, freezes, locks up apparently due to lack of free space (6-8 hours max with a reboot required to return to a workable state)!!! I am a newb to Linux programming so the detailed Gentoo wiki is going over my head at present. Can you assist with an explanation and hopefully a fix to what I perceive as a memory leak or a fundamentally broken garbage collection routine behind the scenes of zRAM? Other than this it turns the Pi into a fully fledged PC workstation! 1GB of RAM is not enough. 3 tabs open in Chrome crashes the Pi as pop-ups declaring "Not Responding" take up the last workable memory space and effectively lock up the system completely! The Pi Foundation does not appear to recognise this memory issue as a fact at present! zRAM makes the differences clear to appreciate. Thank you for all your efforts. Very much appreciated (heroic applause!)
I have followed the instructions exactly, but when i reboot my machine my swap is only at 497mb I am using a RPi2 with Ubuntu Mate, any clue what might be wrong?
For anyone who is interested i figured out how to fix this in Ubuntu, you need to edit > /usr/bin/init-zram-swapping and replace everything with the script that Nova has supplied and then it will work properly :) Now I just need to figure out how to get conky to launch automatically with Ubuntu Mate and LXDE!
Don't use a swap partition on a thumb drive, it will kill it. Just use zram and the swapping will occur on a compressed space in memory which is volatile. Thumb drives are like SSD drives in the sense that the chip has a certain maximum number of write cycles before it completely fails and becomes unusable. Some cheap thumb drives have a max. of 5,000 writes. Some expensive ones have max. of 25,000 writes.
is their a reason why those like me with the pi zero are getting ignored on this particular ZRAM topic? "does this work on a zero? " im yet to buy one in micro center for $4.99 and i would like to know about this prior to buying, thanks in advance!
Hey bro... Your tutorials are Awesome!. I always use them. The Tutorial I love most is the wifi hotspot router. But since I bought am Pi3 I couldn´t do it work with built in wifi. Please could you teach ys how to do it on Pi3 and built in wifi??
First, thanks Don for all the nice work on pies (sp?]. I recently got this working myself on a pi-3, and heads up Don - a couple of things in the old tutorials don't work due to slight changes in boot timing, as in hostapd trying to be a hotspot before it has an IP on eth0 and so on. So some goes in rc.local and some in .profile etc to restart services that systemd crashes on boot due to running them in the wrong order if you use the older tutorials.
Is there any way to make youtube video look better on raspian. It is lagging a lot. I was hoping that this ram/swap solution would fix it but it has not...?
you would need to add more ram to your video and make sure you use chromium with the h264ify extension which forces youtube to serve videos in a format which can be accelerated by the pi's hardware
This is swap, not ram. *Swap is not ram* and swap cannot ever hope to be as fast as ram. The point of ram so you can read data quickly. As of now im pretty sure there's no way of adding ram aside from some extreme board modifications (Even then, im not sure if pi itself will be happy with the mod). Swap works by, instead of writing to ram, writing to the disk or something. This method just makes swap more efficient. But it's still not as fast. To decrease the amount of ram being used, I have installed xfce and iceweasel (firefox) since they don't eat up too much ram and resources.
If swap makes partitions *in the ram* then there's no point to swap as it'd just take up ram. as I've said, swap space acts like ram but whatever would be written to the ram would be written on the disk. Usually if the ram is 100% full. z"ram" just makes it compressed.
You didn't speak too much about loading and running Conky. How does it start? Also looking at your "read me" file on GITHUB, I noticed you are missing the term "sudo" on the "download the conkyrc file to home directory as .conkyrc" command line "wget -O /home/pi/.conkyrc raw.githubusercontent.com/novaspirit/rpi_conky/master/rpi3_conkyrc
My pi3 is so slow in streaming videos. I wish if I could have increase the ram a little bit so that I can browse internet and watch videos without buffering.
There has to be a downside to this other than small CPU cycles? Why don't all Android devices use this for example? You could even have a small, low cost, co-processor to deal with the task... Just sounds too good to be true to me :-)
I like conky! I have installed it on my virtual debian linux box as well. I use the same script as on RPI but the background comes out black and not transparent. Any clue why? Thanks!
I have a linux system with 8Gb of Ram ( Suggestion Size for swamp memory is double that of the ram you have) so i made my swp Memory 16Gb. Would it be any benefit for me to make zram for my system or is it better for me to leave as is? I have read some blogs on how you can make zram the primary and swap secondary. Would this be any benefit to go this route or to leave as is? Im just curious because my swp has saved many times from crashing my programs from running too many virtual machines at one time, and im just seeking alternative ways to help my memory close calls issues. Im just curious on you take on this matter. I looking forward to anyone's response on this subject.
Thanks a lot... Plz try to make more videos.... At least 2 or 3 videos a week.... All your videos are amazing and interesting. Specifically for raspberry pi lovers.
You need to slow down a bit, especially for us noobs to the Raspberry PI 3. I like the idea of adding an extra 1 GB RAM with using zram, but I cannot follow your scripts. You did it so fast I couldn't keep up. I've replayed the video several times to figure out how you did this. I don't know a thing about editing a config file.
I followed your blog and my swap shows 1GiB now. But it shows 0B / 1GiB... shouldn't that be doing something ? Also, my zram.sh file looks nothing like the one in this video ;-/ #!/bin/bash cores=$(nproc --all) modprobe zram num_devices=$cores swapoff -a totalmem=`free | grep -e "^Mem:" | awk '{print $2}'` mem=$(( ($totalmem / $cores)* 1024 )) core=0 while [ $core -lt $cores ]; do echo $mem > /sys/block/zram$core/disksize mkswap /dev/zram$core swapon -p 5 /dev/zram$core let core=core+1 done
Today I learned how to download more RAM.
For once it isn't a lie, lol
Downloud ram is possible !!!
i knew it !!
Ya but you need storage to turn into ram so get a better sd card or graphic card
@@quirkychamp9152 but thats slower than RAM
In 2020 I was able to download rom 😎.
For everyone that thinks this is magically "adding MORE RAM" to your RPI, all it does is it compresses "makes smaller" the stuff that is temporarily stored on the RAM by the CPU. This allows the CPU to put more stuff in RAM as now the space the the other stuff is smaller allowing you to put MORE in the same AMOUNT of RAM. The "side-effect" of this is that compression algorithms are not 100% efficient which means you will have to wait longer when the data on the RAM has to be decompressed then executed by the CPU.
Thanks
Thanks! This short video is really helpful: didn't know about htop, conky, and zram. Got them both and with your config file it was no issue to get it running. Thanks again!
Works really well, totally worth it, if a pi is rich in CPU cycles and low on memory, this is a no brainner, Raspbian and Retropie, Kodi, will work better with this script.
William Rutter will it make Plex transcoding better on the raspberry pi?
@@enochthestud No, transcoding is cpu/gpu dependent.
Next time on Novaspirit Tech: downloading a GPU
Next time on Novaspirit Tech: downloading a gaming pc
one of the fastest and best youtubers on explaining without all BS, top notch!!!
imagine how much time saved, hope you will do some Bitcoin,ethereum, ZEC, Dash CPU mining on a Raspberry pi. Keep posting.
and clustering raspberry pi for better performance on mining
OMG thank you my system was SO SLOW i couldn't even run 2 tabs without glitch now i can run 8 tabs FASTER than before with 2 tabs
Guys - before making comments - this is a ram compression scheme - it is NOT more RAM - you cannot GET more RAM for the Pi without getting an ultrafine soldering iron out - and I'm not even aware of anyone who has done that successfully. If you want more RAM there are plenty of alternative boards out there with 2GB RAM.
Aww man downlouding ram is still a lie 😢😢😢😢
@ExoPhantomFalcon fuck me from 1 year ago is cringey as fuck
@ExoPhantomFalcon im one of what people ?
You install your own programs and scripts in /usr/local/bin, not in /usr/bin or in /bin. Those are reserved for Debian to install its own binaries from packages.
if you do it, it could turn out to be a problem later.
You can avoid issues by not creating scripts that are named after other binaries in one's distro's repositories. Also...
Arch > Debian
This is a good point. Changing my setup. I was vaguely suspicious about the path but too excited about the new toy.
I got it working! Figured out to use cursor to select line... got Conky going too and the first thing I noticed video plays without any lag with large display size definitely faster showing the 1Gig swap in Conky but temps up from around 38C to 45C and cpu usage about 50%, stop the video and it drops down to almost normal, was 0% at idle now lowest is about 5%. The trade off seems absolutely worth it considering the almost unwatchable slow buffering of video before, thanks really appreciate your Conky and Zram files and info!
I already miss being able to use xz compression as I used to with COMPCACHE. It's slower per operation, but operations are less frequent, and its compression is enough better than the rest that it's overall faster due to even less swapping to a slower device.
Extremely well done. I'm gonna give this a try on my kitchen-pi terminal. It's streaming video and doing Amazon Alexa at the same time so this might give it a bit of a "boost" . Thanks for the video. Eric
you got a great channel there ERIC! lets get together sometime and make stuff happen, hope you don't mind if i email you?
Novaspirit Tech Thanks for the kind words. Sure sounds good. Merry Christmas.
email sent =) merry Christmas to you too
not possible it would suffer the optimization or minecraft java and for that matter java itself is horific you could run minecraft c++ so PE or win10 if you got the source code...
To be honest,i love raspi and all.but to 4gb you need an Ryzen microAtx and the full Rig Micro atx...it goest better and tiny as well as maybe the double of pi cases size.
I was planing sell my fx8350 to get one full rig micro atx...but i didnt sold..i keep because i builded less than 1 month before..but it worth the size and money!
zram just creates compressed swap on RAM. This makes sense for this use but you're explaining it really badly.
memory isn't "echo'd" into zram. Those echo lines in that script are setting the size of the devices by writing that size to /sys virtual files.
It's also not really giving you an extra 1GB of RAM. I'm guessing the ZRAM devices are allocated dynamically, so they grow as they fill up, so your RAM will reduce as data is swapped out, and the amount of space you gain by swapping it out will really come down to the compressibility of the data.
Could you make a video to show how to use a usb drive for more ram? For the raspberry pi.
I hope this works like you say it does. Because the Pi's could do with maybe another 2gb. The makers should have a look at upping the ram. I don't think any of us would mind a couple extra bucks for a 2+gb model.
I’m blessed to be alive to see this🙏🙏
ZRAM will not create an additional GB of RAM, that is a lie, SWAP is a cache space to store temporary data
he explains that at the beginning of the video...
zram compresses swap and stores it in ram.
true
This why i like the pi, and the community. Exellent !!!!!!!!!!!!!!!!!!!!!!!!!
This nothing great/new even windows can do it and every other os...
Interesting stuff. So how much physical RAM does that swap pool actually take when it's full? How much slower is it? What kind of CPU usage should we expect?
Thanks. I did a PR for your ZRAM script to make it dynamic (so it supports not only Raspberry Pi but other SBCs and even PCs). I intend to utilize this on NEMS Linux (Nagios for Raspberry Pi).
thanks!! i saw your commits, well done. i will be updating the git.
Cool. Thanks for putting it together. I was looking for a decent way to maximize the RAM of the Pi 3 for NEMS, and this looks like a great way. The Pi community are die-hard and while I have many users who don't mind spending extra to get a more powerful SBC, this adds a bit of life to those aging Pi 3's. But now with this PR your script will work on any, so that's great. Thanks for the merge.
I love this. Thank you. I have been looking for ways to use the SD card to add more RAM. There is a way to do it on rooted android devices, so I figured that there surely was some way on this. This is close though and a great idea, I will check that out asap. Is this the pi OS?
Great Job hope you feel better
Don, I am running Raspian with persistence from a USB, because my windows 10 hard drive crapped out on me on a Dell Desktop. I figured why not since all my other computers are Raspberry pi's or running some variant of Debian. This computer has two cpu's AMD Athlon(tm) II X2 250 Processors they are dual core (so together 4 cores). Regardless of the internal RAM and the SWAP space would enabling ZRAM increase performance. Its not slow by any means, but today a decent computer comes stock with 8gb RAM out of the box. This computer is right now the command and control for my small army of Pi's and other Linux boxes so every bit helps. If you could get back I would appreciate it, thanks.
wow same here, my hard drive also went
I use a single raspberry pi 3 b+ to host a small minecraft server as a test server, would this improve the server lag in any way
Better way to increase the SWAP is edit dphys-swapfile:
Before we can increase our Raspberry Pi’s swap file
**sudo dphys-swapfile swapoff
Modify the swap file configuration file
**sudo nano /etc/dphys-swapfile
Search and modify CONF_SWAPSIZE=100
For example, if we wanted to increase our swap size to 1GB, we would change that line to the following:
**CONF_SWAPSIZE=1024
Next save the file by pressing CTRL + X, followed by Y, then ENTER.
Now restart your device.
**sudo reboot
Swap file will not increase performance of your system. However, it will let you run applications when you used all of your RAM capacity.
What about overclocking? Wouldn't it be more helpful?
Another efficient way to increase the SWAP is from dphys-swapfile:
$ sudo nano /etc/dphys-swapfile
# For 1GB
CONF_SWAPFILE=1025
# For 2GB
# CONF_SWAPFILE=2050
As usual cool video. Thanks so much for your efforts.
Looks good.I will have to try it when I can. Thanks.
This Script just stuffed up my SD card I've been running for 6 months and sadly, I was going to back up later today
Your variable labeled "totalmem" needs to be rid of those depreciated backticks. Backticks for command substitution creates subshells which hinder performance of your bash scripts. Proper command substitution uses "$(commands here)" It should look like this:
totalmem="$(free | grep -e '^Mem:' | awk '{print 2}')"
Trust me, I am a bash guru. Brilliant video and very nice work.
This is great. I am using Raspian Jessie lite - command line only. Can i do the same configuration for command line? I am a java-nerd so all my rpi apps are in Java.
So Zswap ended up being a much better bet. Is it worth doing some memory management on the new Pi4?
What is that thing you have the desktop not sure if you said carnky or something else either way can't find anything on the Internet for it or anything for it
This description is bad. However I loaded Conky and setup zram on my Pi4 today and the speed increase is noticeably faster. Trade off is the CPU is averaging higher load. Playing around with the disk space I notice my swap partition gets larger but does not seem to be used any longer? I have the 2GB model and leave only 256MB for the GPU share. My Pi4 is running well now. Looking forward to further testing.
Thank you for sharing this resource with us. Now I know of a way to increase the RAM on my Pi.
You aren't increasing your RAM. You are compressing data that is stored in RAM so more is available in the virtual memory space. Overall RAM remains the same.
Bro when you opened the black window I saw my whole eyeball in my reflection..
Hi my dear friend!!! First of all, congratulations for video!!! What software should I install to have this window with raspberry's informations on my desktop like you?
Sense this is for the raspberry pi 3. Would this work on the raspberry pi 4? I have one of the cm4 compute module 4 and it only haves 1gb. And needing more. Sense I don’t use monitors it’s all headless will this work?
Thankyou NovaSpirit Tech
Awesome video, Thanks!
By the way, any ideas on how to make a portable display for raspberry pi and a powerbank?
I was thinking on using phone batteries
i did something like that on my kali linux video ua-cam.com/video/6xXnUGR_e4E/v-deo.html using a powerbank that is normally used to charge phones with a 5" touchscreen display.
Worked fine for me, how do you get conky looking nice like yours, the original one really kills my screen :D
I see your running HTOP. I also suggest joe, (it's like Wordstar of the 80's), also mc, it looks like norton DOS util.
if it doesn't work for anyone check the Exec line: make sure it goes Exec=sh /usr/bin/conky.sh ...fixed it for me
May I ask how to get these neat stats on the desktop, too?
hi and thanks for the video. is there a way to use these feature on an android tv box ?
so how does this Increase the Ram on the pi just wondering?
...no. A Swap partition is basically just using the Hard drive (or flash media, or whatever you have the OS installed on) as RAM... albeit at a much much much slower rate.
So while yes this will give you "more ram" it probably won't have much of an effect, hell it might even slow the system down.
It doesn't, it effectively will compress rarely used sections of memory to free up some space, but it's not adding any memory to your device at all.
Was going to say get the soldering iron out. But the chip doesn't have external ram on the board :(
It's called Bullshit. It's been going for many years.
We used to call this "Virtual Memory," back in the '90s, before it became so commonplace, you didn't even get to choose how much of your HDD, etc. RAM you'll allow the OS to use, for it.
Need help please... cannot edit script “sudo nano /etc/rc.local”, terminal writes “/usr/bin/zram.sh &” to the beginning before the first “#” at top. How do I insert where you did?
Also how does ZRAM compare to ZSWAP? Or does it matter on the OS of the raspberry pi?
How does zram fair for GPU/vram
So it's like vram? v as in virtual. On windows?
Has this been at all tested on Retro Pi? and has it at all effected any of the emulators like the N64 etc etc? i'm currently using the Raspberry Pi 3 and was curious about it.
2gb is way more than any retro gaming console. the xbox 360 has 512mb of ram. RetroPi doesn't need more ram. Faster ram might help the emulator run better on PlayStation games but this mod will slow the ram as it has to compress and dump to storage.
Don't bother with this for RetroPi it won't help
Hey man, I love your videos! You rock.
I went to your site and got your conky config file, thank you for that. I was wondering if you could help us noobs get conky to boot up on start up.
Thanks, RP
Also I cannot get the conky config file to work in Kali. What folder should it be placed in. Thanks!
Your program is different in github as shown in the video. Which one do I need to follow ? Github or the one in this video for Zram. Im having Raspberry pi 3 b+
For whom which is trying to write the correct word of the lightweight free system monitor shown in the video, the name is "Conky". Who doesn't have English as a mother language is having trouble to find it.
What is 1024 representing? It is used to multiply 1/4 of the totalmem variable (if totalmem is not a variable, feel free to correct me, I don't know bash scripting). I initially assumed that it represented the Pi 3's RAM in MB, but in the zram script that debian has posted, it uses 1024 as a value like this: print $1*1024;
so at a complete guess could it be compressing 1gb of ram (1024mb) and keeping 1024mb uncompressed so the system didn't slow down due to compression overhead.
The pagefile could be 2x ram (4096mb) and 1/4 of it would be 1024mb.
This is my guess
How do you get the system display graph is there a way to install it
Question, How well will this process work with a Plex Server (using a PI 4 8GB). I'm getting buffering when 2-3 people are using it. Thanks
What do you recommend to get Conky to launch at boot time? I've seen five different methods and I am still having trouble.
which reminds me that zram swap can also works on my android
totally awesome, thank you for this nice hack to prolong life of SD card
how do you run wbar? I installed "sudo apt-get install wbar wbar-config" but it not displayed on the screen ? Can you show me?
its not wbar-config its wbar.config
logout of your session and log back in
Hi, I have a RPi3 with your installation of zRAM that works fine initially but the free RAM decreass over time until the Pi crashes, freezes, locks up apparently due to lack of free space (6-8 hours max with a reboot required to return to a workable state)!!! I am a newb to Linux programming so the detailed Gentoo wiki is going over my head at present. Can you assist with an explanation and hopefully a fix to what I perceive as a memory leak or a fundamentally broken garbage collection routine behind the scenes of zRAM? Other than this it turns the Pi into a fully fledged PC workstation! 1GB of RAM is not enough. 3 tabs open in Chrome crashes the Pi as pop-ups declaring "Not Responding" take up the last workable memory space and effectively lock up the system completely! The Pi Foundation does not appear to recognise this memory issue as a fact at present! zRAM makes the differences clear to appreciate. Thank you for all your efforts. Very much appreciated (heroic applause!)
How about Download more Ram?
I have followed the instructions exactly, but when i reboot my machine my swap is only at 497mb I am using a RPi2 with Ubuntu Mate, any clue what might be wrong?
For anyone who is interested i figured out how to fix this in Ubuntu, you need to edit > /usr/bin/init-zram-swapping and replace everything with the script that Nova has supplied and then it will work properly :) Now I just need to figure out how to get conky to launch automatically with Ubuntu Mate and LXDE!
Utterly fantastic!
how can i get that rpi linux monitor that you have on your desktop?
How did you press to save that change?
Raspberry Pi Zero W ?
Look forward to more videos
Thank you
While using Z-RAM, does it require you to lose some storage other than installing the program?
I used a swap partition on a thumb drive, not too familiar with zram.
Don't use a swap partition on a thumb drive, it will kill it. Just use zram and the swapping will occur on a compressed space in memory which is volatile. Thumb drives are like SSD drives in the sense that the chip has a certain maximum number of write cycles before it completely fails and becomes unusable. Some cheap thumb drives have a max. of 5,000 writes. Some expensive ones have max. of 25,000 writes.
is their a reason why those like me with the pi zero are getting ignored on this particular ZRAM topic? "does this work on a zero? " im yet to buy one in micro center for $4.99 and i would like to know about this prior to buying, thanks in advance!
I want to know it too, i’m trying to do it right now
Hey bro... Your tutorials are Awesome!. I always use them. The Tutorial I love most is the wifi hotspot router. But since I bought am Pi3 I couldn´t do it work with built in wifi. Please could you teach ys how to do it on Pi3 and built in wifi??
First, thanks Don for all the nice work on pies (sp?]. I recently got this working myself on a pi-3, and heads up Don - a couple of things in the old tutorials don't work due to slight changes in boot timing, as in hostapd trying to be a hotspot before it has an IP on eth0 and so on. So some goes in rc.local and some in .profile etc to restart services that systemd crashes on boot due to running them in the wrong order if you use the older tutorials.
See here for a link to a working image on pi-3: www.coultersmithing.com/forums/viewtopic.php?f=59&t=979&start=0 (scroll down)
How are you recording the screen?
Is there any way to make youtube video look better on raspian. It is lagging a lot. I was hoping that this ram/swap solution would fix it but it has not...?
you would need to add more ram to your video and make sure you use chromium with the h264ify extension which forces youtube to serve videos in a format which can be accelerated by the pi's hardware
Thanks, excellent suggestion!
This is swap, not ram. *Swap is not ram* and swap cannot ever hope to be as fast as ram.
The point of ram so you can read data quickly. As of now im pretty sure there's no way of adding ram aside from some extreme board modifications (Even then, im not sure if pi itself will be happy with the mod).
Swap works by, instead of writing to ram, writing to the disk or something. This method just makes swap more efficient. But it's still not as fast.
To decrease the amount of ram being used, I have installed xfce and iceweasel (firefox) since they don't eat up too much ram and resources.
If swap makes partitions *in the ram* then there's no point to swap as it'd just take up ram. as I've said, swap space acts like ram but whatever would be written to the ram would be written on the disk. Usually if the ram is 100% full. z"ram" just makes it compressed.
You didn't speak too much about loading and running Conky. How does it start? Also looking at your "read me" file on GITHUB, I noticed you are missing the term "sudo" on the "download the conkyrc file to home directory as .conkyrc" command line "wget -O /home/pi/.conkyrc raw.githubusercontent.com/novaspirit/rpi_conky/master/rpi3_conkyrc
ohh ned it for windows 11 in my rpi3b+
I don’t think you can just DOWNLOAD extra storage...........
Finely found Conky, (or however it's spelled!) Does it ONLY work with a: Pi 3 ?
Also, where is zram?
zram is apparently installed with the pi
My pi3 is so slow in streaming videos. I wish if I could have increase the ram a little bit so that I can browse internet and watch videos without buffering.
There has to be a downside to this other than small CPU cycles?
Why don't all Android devices use this for example?
You could even have a small, low cost, co-processor to deal with the task...
Just sounds too good to be true to me :-)
What is the command to see if the file worked correctly?
@NovaspiritTech do you how can I change the degree display from celcius to farenheit in conky?
REPLY
Ommar del Rio F = C × 1.8 + 32 . . . . Math is cool. You may have to read the conky wiki to figure out how to make math work though
After reboot my ram are only 114 mb. How to fix it ? Thank you.
Does ZRAM work for the pi Zero? If so do I have to change the config file?
You install xfce to Rasbian? How?
theres a new script and idk if it worked because in htop it only say Ok/Ok under the section Swp. Pls help
I like conky! I have installed it on my virtual debian linux box as well. I use the same script as on RPI but the background comes out black and not transparent. Any clue why? Thanks!
I have a linux system with 8Gb of Ram ( Suggestion Size for swamp memory is double that of the ram you have) so i made my swp Memory 16Gb. Would it be any benefit for me to make zram for my system or is it better for me to leave as is? I have read some blogs on how you can make zram the primary and swap secondary. Would this be any benefit to go this route or to leave as is? Im just curious because my swp has saved many times from crashing my programs from running too many virtual machines at one time, and im just seeking alternative ways to help my memory close calls issues. Im just curious on you take on this matter. I looking forward to anyone's response on this subject.
Where is the zRAM coming from if it's not from the SDCard?
has the Zram file been erased from Github?????
Thanks a lot... Plz try to make more videos.... At least 2 or 3 videos a week.... All your videos are amazing and interesting. Specifically for raspberry pi lovers.
thank you so much!, 2017 will be the year to concentrate on those task
Dude! 2 or 3 videos a week is massive work XD
Does this work on a Pi Zero?
Somebody can say me if this actually increase performance? For example I'm hosting minecraft server, will this reduce lag? A little bit?
You need to slow down a bit, especially for us noobs to the Raspberry PI 3. I like the idea of adding an extra 1 GB RAM with using zram, but I cannot follow your scripts. You did it so fast I couldn't keep up. I've replayed the video several times to figure out how you did this. I don't know a thing about editing a config file.
hi how do you save this script in bin folder because the terminal says that i cannot save due to permission
try typing the command "sudo" before all the lines of code .
on every line
I followed your blog and my swap shows 1GiB now. But it shows 0B / 1GiB... shouldn't that be doing something ?
Also, my zram.sh file looks nothing like the one in this video ;-/
#!/bin/bash
cores=$(nproc --all)
modprobe zram num_devices=$cores
swapoff -a
totalmem=`free | grep -e "^Mem:" | awk '{print $2}'`
mem=$(( ($totalmem / $cores)* 1024 ))
core=0
while [ $core -lt $cores ]; do
echo $mem > /sys/block/zram$core/disksize
mkswap /dev/zram$core
swapon -p 5 /dev/zram$core
let core=core+1
done