Pi 4 & Virtual Memory maxed out Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
morphious
Posts: 12
Joined: Fri Jul 12, 2019 6:26 pm

Pi 4 & Virtual Memory maxed out

Post by morphious »

HI, I have a Raspberry Pi4 with the most current DietPi installed. For the last year I've had the issue of the Virtual Memory sitting at 100% full after about an hour of reboot and it just stays at 100%. Is there any way to increase the VM size?

Real memory: 1.87 GiB total / 344.95 MiB free / 157.42 MiB cached Swap space: 58.99 MiB total / 328 KiB free

The system is used to host a single website using Apache web server and MariaDB Database Server. All system files are updated weekly.

I have dropped the amount of apache hosts that open by 50%, but this just means the VM takes longer before it fills up.

Any assistance would be greatly appreciated.

-D
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Pi 4 & Virtual Memory maxed out

Post by Joulinar »

Hi,

did you tried to increase SWAP file?

Code: Select all

/boot/dietpi/func/dietpi-set_swapfile 2048
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
morphious
Posts: 12
Joined: Fri Jul 12, 2019 6:26 pm

Re: Pi 4 & Virtual Memory maxed out

Post by morphious »

That fixed the issue. Thank you! Previously when I first installed the Pi4 tis was not a functioning option. Glad to see it was resolved!
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Pi 4 & Virtual Memory maxed out

Post by Joulinar »

you should keep an eye on SWAP usage. It could slow down your system if it is used on a higher level for a longer period of time. Just use free -m to check memory usage.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
WarHawk
Posts: 732
Joined: Thu Jul 20, 2017 8:55 am

Re: Pi 4 & Virtual Memory maxed out

Post by WarHawk »

do cat /proc/swaps

Do you have zram compressed RAM?
it might help
morphious
Posts: 12
Joined: Fri Jul 12, 2019 6:26 pm

Re: Pi 4 & Virtual Memory maxed out

Post by morphious »

I do not have Zram but I do have a page caching system for Wordpress which places most page in active RAM. Speeds up the loading by 100%

I do notice that now that I've upped the swap to 2048, the swap has enough breathing room to swap instead of getting clogged up and not releasing files fast enough.

Give it a try. this is the site, hosted at my house.... http://ei.house/
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Pi 4 & Virtual Memory maxed out

Post by Joulinar »

if your system require that much memory, you might think of a Rpi with 4 or 8GB phys memory
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
WarHawk
Posts: 732
Joined: Thu Jul 20, 2017 8:55 am

Re: Pi 4 & Virtual Memory maxed out

Post by WarHawk »

Yeah...having a large physical swap file can wear out a SD card rather quickly...especially if it reads/writes alot

Zram will help with that immensely (if you have latest release it should be there I believe)
If not you can install it with zram-config (since it's Debian based)

Biggest thing with the RPi is it's limited RAM...the latest models have alot more than the older versions

However your website is pretty sweet..a wee bit sluggish but that is to be expected!
Also a really neat project!
morphious
Posts: 12
Joined: Fri Jul 12, 2019 6:26 pm

Re: Pi 4 & Virtual Memory maxed out

Post by morphious »

thank you! will definitely look to get the 8gb version in here ASAP and hopefully remove the need for any swap access at all.
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Pi 4 & Virtual Memory maxed out

Post by Joulinar »

yep that would be best solution :)
Usully you should be able to simply move SD Card from one device to another without issues.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply