Out of memory issues Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
User avatar
SanPe
Posts: 10
Joined: Tue Nov 28, 2017 7:08 am

Out of memory issues

Post by SanPe »

Hi,

First of all: happy holidays :)

I have an issue for the past month or so, transmission or airsonic is regurally killed by DietPi.
When searching the logs, I found out that it's because the system is out of memory.
This leads me to this question:
what can I do?
- to understand why it is running low?
- to find a workaround?

I'm using an Odroid C2, with last version of Dietpi, and using proftpd, mariadb, php7.4, apache2, transmission, airsonic, medusa, jackett, syncthing, webmin, fail2ban, rsyslog.

Thanks!
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: Out of memory issues

Post by Joulinar »

Hi,

I guess you would need to find out how your memory is utilized on your system. Probably you can use "free -m" or "htop" to check how it looks like. Maybe you are running short in phys mem.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
SanPe
Posts: 10
Joined: Tue Nov 28, 2017 7:08 am

Re: Out of memory issues

Post by SanPe »

Here's htop command result:
Image

Both medusa and airsonic are at 25%+
Physical mem is at 1,17 of 1,6G, Swamp at 209 of 321M...

That's a lot, right?
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: Out of memory issues

Post by Joulinar »

yep your mem is nearly gone. So indeed your are running out of phys mem and swap. Swap file could be increased but might not be the best option (reduction in performance and increase of I/O). First you could restart your entire system (SBC) to clean all the allocated mem. if after a restart you still use all of your mem, you should rethink to get a device with more phys mem (like 4GB RPi4) or to reduce number of applications running. Usually medusa or airsonic as they use the most. 3rd option would be to have a 2nd device. That would allow to split the load :)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
SanPe
Posts: 10
Joined: Tue Nov 28, 2017 7:08 am

Re: Out of memory issues

Post by SanPe »

I reduced the size of medusa db, and rebooted the sbc. Memory is back, but well, I know it's gonna go again.

I can see in htop that airsonic is launched with the -Xmx345m option, which allocate only 345M of memory. Why is it using +400M then? :(

I'll maybe add a cron job to reboot every night or something if I cannot find another way.

Thanks!
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: Out of memory issues

Post by Joulinar »

well not sure if the additional 50M of airsonic will save your life. But maybe something you would need to check with the developer of airsonic why its using more than configure. Could be some more memory areas are loaded, not only heap 8)

Indeed rebooting every night might help. Even a proofed concept in real IT hosting as well to avoid memory leaks and system running out of mem :P You could use DietPi cron function to have such a rebooting script setup

But if you still have such memory needs on your system, it might be better to increase hardware - get a new device ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
SanPe
Posts: 10
Joined: Tue Nov 28, 2017 7:08 am

Re: Out of memory issues

Post by SanPe »

I'll consider it...
Raspberry pi 4 or Rock64 :?
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: Out of memory issues

Post by Joulinar »

Personally I'm using a RPi4 4GB. Usually RPi should have a larger community/support. But I guess it depends on your own preferences at the end.
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: 606
Joined: Thu Jul 20, 2017 8:55 am

Re: Out of memory issues

Post by WarHawk »

Does the kernel support zram?

Worse comes to worse...create a swap file and expand your existing swap (but it will wear out your SD card ALOT quicker)

Remember SBC's are about 1/4 capable computers...they are not massive powerhouses...heck even a cheap old anemic laptop with dual or quad core is more capable than most SBC's

They are good for only one or two large applications for dedication...too many and it bogs it down hardcore

Do you have a NAS that is capable of NFS, then create a swap file there...this way it doesn't use the SD card but still expands the swap size
tmpfs nfs swapfile - use one computer's RAM as SWAP for another computer
Post Reply