Version 23.05.0-rc1 eats up all memory

It becomes impossible to use luci-app-adblock on routers with 64 MB of RAM

There's a reason why 8/64 devices aren't encouraged anymore.

4 Likes

In general, I understood a little. I have the adguard_tracking filter enabled in Adblock and today's database update has something loaded in it a lot, and since zram-swap does not work on version 23.05.0-rc1, there is not enough memory and the router hangs, I installed the zram-swap package exactly for a similar situation, and he always helped out, but for some reason he does not work on the new version

I doubt that is the problem. It is adblock and it’s database that is the problem.

Swap…yea but swap to what? Swap in linux is usually harddrive memory that is allocated for use as emergency memory allocation. But swap is only a less bad solution to survive a total crash scenario at best.

No normal computer usage should ever want to think about using swap to begin with.

So you have three ways forward.

  1. Use smaller/minimum/less functions in adblock database.
  2. Stop using adblock or use a smaller alternative solution.
  3. A router with more memory, if you ask me move to 1GB and simply stop thinking about memory problems and work arounds.

There is possibly another solution that maybe can work if you can use a USB flash drive for the adblock database. But that is just delaying the problem to next year release.

To be fair, adblock itself isn't an issue either - the size of your loaded blocklists can be, especially with very little system RAM. 128 MB RAM devices already need adapted expectations (small, curated, blocklists), but I can also kill a 512 MB RAM system with huge blocklists easily; with 64 MB RAM you really need to be picky of what must be blocked and what you can live with.

Thanks, I already understood what the problem was, I had to install kmod-lib-lzo, since it is missing in the new version and zram started working for me. I just set up the adblock together with zram, in case of an unexpected large list, so that the router does not freeze and 64 MB of memory is enough for me

Obviosly not since we actually have this tread to begin with.

If this is needed, why wasn’t that installed to begin with as a dependable for zram?

Lzo, your router survive by compressing the data stored in ram during runtime which moves the work back to the cpu to uncompress the ram data to actually see what is stored in ram to begin with, which will drastically slow down the performance of the router.
The whole idea with ram in a computer is for the cpu to have access to uncompressed work data, accessed at a moments notice with very high speed compared to data access on static memory on HDD/flash/eprom etc.

So the title of this topic is wrong. Since using adblock lists on devices that can barely run recent OpenWrt builds alone is nothing but an user error.
Sure, OpenWrt lets you go wild and run everything you can think of on that cheap silicon, but there are limits on how well (if) it will run.
So yeah, misleading topic, sounded like a memory leak but nothing of the sorts.
Clickbait.

Well, I also have noticed something on this matter on 23.05.0-rc1 but also on the previous snapshots, I have one GLinet B1300 ( ipq40 256mb ram) and it uses 51% of the total memory, while on Linksys EA7300 (mediatek 256mb ram) i have 67% free, with exactly the same configuration on both.
There is a reason for this? Can this be "optimized"?
Thanks

I have the same configuration on two identical models. With the new firmware, 18 is free, and with the previous one, 22 MB is free. Perhaps this is somehow connected in the new version with sha512, and in the previous one it costs kmod-crypto-sha256, I don’t know, I just guess

I don’t think you can see it that way. That is two different hardware devices with two different source code setups and the same packages can have different code build on different hardware based on that specific hardware specs.

ath10k (and ath11k on ipq807x/ ipq60xx/ ipq50xx) needs more RAM for the wireless hardware (and the SOC itself also reserves a little more for its other IP blocks) than mt76. That difference is down to the basic hardware design (RAM usage also grows with each connected client) and can't be 'fixed'.

Mediatek hardware can usually get by with less physical RAM than contemporary QCA hardware, but that often also means that the manufacturer puts less on the board to begin with.

1 Like

but it still consumes a little more RAM, but it seems to work not bad, while I'm just testing

archer c20 v5 (MT7628AN) 4 MB began to eat more RAM

You are indeed right, btw the memory usage used to be very similar on 22.03.x for both devices, this is why I had the idea they should still go with similar memory usage, but as you said the code is just different so... mem usage can be different
Thanks

Thanks for clarifying.
From a "comparison" point of view, I understand that the mediatek Is more cheap/less sophisticated, my perception (alternating mt76 and ipq40, for a basic usage) is that the mediatek runs a lot more "smooth" with openwrt, in the wireless and as "general" performace, very reliabe.
So, even if is a cheaper device, I tend to prefer that as overall device. Do you think I'm totally wrong (I'm looking for an advice here)?
Thanks

Compare memory usage between different branches becomes almost impossible and not that meaningful.
Every stable branch has a new Linux kernel, with that comes modified and updated packages and drivers. Code gets more effective over time and new code arrives or changes and known bad code gets removes.
All this finally sums up in memory usage.

Ok. From a "user" point of view btw I'm a little worried about the growing HW demand with new kernels/release. Mainly because there is not much choice of devices with strong cpu and ram on the market compatible with Operwrt. Btw thanks for the explanation.
Regards

2 Likes

this is a very vague statement, but have you checked the devices using the ipq807x and perhaps filogic targets ?

Well, Table of Hardware reports 9 ipq807x devices supported (by snapshot).
Btw I think it's not vague to say that most of the compatible devices have less than 256mb of ram, for what that can mean.

1 Like