Continuous RAM/memory consumption increase over time

I am using the latest OpenWrt 23.05.4 on the Gli.Net MT6000 router, I have 10 laptop, phone, tablet and 10 IoT devices, plus I have installed Adguard Home, all the Wifi radios are OFF because I have a separate AP. I am using TMHI (T-Mobile Home Internet), therefore the MT6000 is behind the TMHI Gateway who acts mainly as a modem, so the only things the MT6000 is doing, are, routing and AdGuard.

When I rebooted the router 10 days ago, memory/RAM usage was around 200MB out of a total of 1GB RAM, every day I have noticed how the memory usage increase, today is around 720MB, is that the normal behavior? Thanks

could be, unless the device eventually freezes due to OOM.

You can install zram-swap to ease memory pressure. With your otherwise ascetic setup only culprit seems agh. Every list it loads counts double.

I checked in LuCI Status --> Processes:

132% of Memory Usage:

/usr/bin/AdGuardHome -c /etc/adguardhome.yaml -w /var/adguardhome --no-check-update

1% of Memory usage:

/usr/sbin/collectd -C /tmp/collectd.conf -f

Everything else is 0%

Connected via SSH and this is the output from the top command:

3963 1 root S 1306m 132% 0% /usr/bin/AdGuardHome -c /etc/adguardhome.yaml -w /var/adguardhome --no-check-update

VSZ = 1306m

I am using only one Blocklist HaGeZi Pro++, nothing else

There is no justice in talking. First try zram-swap to grow memory slightly, then when it stops crashing we try to trim down agh if possible at all,

With 1GB of RAM, honestly I don't think the solution to the problem is zram-swap, when the OS is designed to run on systems with 128MB

adguardhome is not among simple programs running on normal systems.
there are much lighter dns blockers available.

How do you check the amount of free/used memory?

ssh to your router and post the output of the command free. This will give you a detailed report on memory usage.

root@mt6000:~# free
              total        used        free      shared  buff/cache   available
Mem:        1012888      160396      268476      480920      584016      321732
Swap:             0           0           0

Please edit and paste COMPLETE OUTPUT formatted as code. ```

1 Like
Mem: 743916K used, 268972K free, 481384K shrd, 44304K buff, 530604K cached
CPU:   0% usr   0% sys   0% nic 100% idle   0% io   0% irq   0% sirq
Load average: 0.00 0.00 0.00 2/137 16570
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 3963     1 root     S    1306m 132%   0% /usr/bin/AdGuardHome -c /etc/adguardhome.yaml -w /var/adguardhome --no-check-update
 2267     1 root     SN    5420   1%   0% /usr/sbin/collectd -C /tmp/collectd.conf -f

Install zram swap, it will use compressed ram-swap and indicate you exceeded normally available memory.

1 Like

Pragmatic solution: Do a weekly/daily reboot. AdGuardHome might have a memory leak, for example, to cause the slow growth. You might contact their support, in case you want a non-pragmatic solution :slight_smile:

1 Like

Please post output of

ubus call system board
opkg list-installed adguardhome

Lets try to gather as much info as possible around your setup to blame bug or your config.

You can close github issue, it pertains agh package or config

Try out adblock-lean. It's a set and forget solution that updates the blocklists daily, and has been designed in such a way as to minimize memory and CPU use whilst preserving plenty of functionality and safeguards. Hagezi lists are fully supported and favoured and Hagezi himself even recommends adblock-lean:

1 Like

I see no reason to worry. About the half of the physical RAM is used for buffering and caching. That's the best the kernel can do with unused RAM. When it needs more for programs and data, it will be taken from the buffering/caching pool.

As long as you have a quarter of RAM free, I wouldn't do anything.

When it gets less than 100 MB, then install the zram-swap package.

tmpfs is buffered cached too.

Are you sure?

As far as I know the memory for tmpfs increases the value for shared memory. Just tested on a Debian Linux client.