High memory usage

Hi,

I have raspberry PI 4B 4GB RAM with openwrt 22.03.2 firmware. I have intermittently lost of wan problem. I suspect the problem is from abnormal high memory usage. The memory usage is 144MiB/3.71GiB 4% after rebooting, and then it climbs up and eats all memory, see snapshot below:

I have same setup on Raspberry Pi 2 1GB RAM with 22.03.2 firmware, the memory usage is steady at around 140MiB/927MiB. See below:

I think there is memory leak on PI4, but I could find the cause. May some help me to find the problem?

144 MB RAM usage would be a bit higher than expected, but not necessarily a problem - the continuously rising RAM usage however certainly is.

Given that there is quite a big potential of 'misconfiguration' (rogue logging, server processes filling up /tmp/ or similar issues), I would start debugging by having a look at the file sizes under /tmp/ and RAM usage of the process via (e.g.) htop, if you don't find a likely culprit rather quickly, starting over with a fresh configuration/ fresh flash and a minimal setup (just WAN/ LAN and the necessary VLAN setups, if applicable) and have a look what happens there for ~a week, before slowly enabling additional features one-by-one.

While the RPi ecosystem might not be the most pleasant one for developers, it has a strong following by OpenWrt users, so I'd be surprised if this was a generic issue for these devices.

Install htop and now I am confused with the memory usage result.
htop shows 53.4MB/3.71GB when openwrt is showing 320MiB/3.71GiB in the luci overview page(I rebooted the router an hour ago so the memory usage is 320M at this moment).
The two values don't match each other.

1 Like

Now I found what is causing the high used memory. I have USB harddrive attached to Pi and shared by samba. I stored a VHD in the USB drive. Everytime I start this VM(the VM uses VHD in shared USB drive) from my laptop, the memory usage increases to the almost the maximum. However, the memory usage stays even after I shut down the vm.
I tried to restart Samba service, it won't reduce the memory usage. How to release the used memory after VM is shut down? or enabling swap space will help?

i had same question, and i have also x86 router with 4gb ram, it look like some caching, don't worry it is not an issue for linux based system

Too much memory cached - Installing and Using OpenWrt - OpenWrt Forum

1 Like

I have to worry because the wan connection becomes unstable under this condition

1 Like

this is the same issue with my CPE220. i will be force to roll back in version 22.02.2.

is it issue? does your connection become unstable? my router memory is always full and it is not means issues, at least in my case

1 Like

Yes, because my clients are complaining about random disconnection in my dumb AP.

1 Like

22.03.3 released, you can try new version, new version contain almost 4 pages of fixes and updates since 22.03.2 version

1 Like

There is always an excitement and enthusiasm as new stable releases start showing up on the downloads page -- and that is great!

1 Like

Hello I have a similar issue, high Ram used (97%) with samba and also experience
some network disconnections.

I first started to notice network disconnections randomly a while back it could happen when not even doing anything online it would go up and down like a yoyo and then a minute or so it would be ok, is this your experience?

I did a further test when this occurred yesterday, checked another 2nd PC hard wire Ethernet connected to the same openwrt router and it remained solid so I think it still could be my network Ethernet port on the PC that is gone bad, I will install a separate card and see how it goes since its so random its hard to tell but in my case it could be a failing network card.

It might be worth you trying the same test as I did above to rule out a possible bad network card also use a network cable tester (mine were fine)

There is also a post here which allows you to flush it, not sure how to do it as a scheduled command that may help you.

Again not 100% on all this above but it is a frustrating issue. I am also on latest openwrt x86 build.

Can you read my post above I left a linked post and what occurs with my clients (network connection going up and down like a yoyo) and let me know if this is similar to what occurs your end?

I am on the latest openwrt build also and experience it. I also left a link on my above post showing how to flush the ram. I think its worth checking the network port or replacing it and double checking the network cable just in case.

Also can you please let me know if you are by chance using the intel i225 or i226 network chipset in your openwrt router or devices at home? since these are known for connection drops it maybe related not sure.

thanks

The problem is actually from my cable modem. I replaced the cable modem several months ago and the wan connection has been fine since then.

Thank you for the info. It is good to know there is a command to flush the memory.

1 Like

thanks for getting back to me, good to hear you fixed the issue and it was a bad modem.

Just out of interest, wanted to ask you do you use an intel i225 or i226 chipset on your openwrt router or devices at home?

These are notorious for network connections going up and down randomly, I am still trying to find the source of my issues.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.