Could not load all filters to memory

When you enable Hostlists in Blokada’s settings - Ad blocking - Host lists you might receive an error message saying “Could not load all filters to memory”. It happens because when you activate lists, Blokada downloads and merges them, removing the duplicated entries. It is a memory intensive process.
It worth to know that on Android every application has its own memory segment (called heap ), no application can utilise the device’s full memory. The heap size is set by the manufacturer of the device, or the maintainer of the ROM, if you use a custom build. It cannot be configured by the user, neither by the application (in our case, Blokada).

When you enable lists, the heap will get full by loading (and merging) them. When this process finishes, the utilisation will lower, there will be a lot of unreferenced objects in the heap that can be removed and thus, precious memory freed up. This clean up is called Garbage Collection (shortly: GC) and it is triggered by the underlaying system (Android). No user nor application can do it.

So, what can you do when you get the “Could not load all filters to memory” error message? Wait. Wait a few minutes till the GC is triggered and Blokada’s heap is cleaned up, then you can continue to enable more lists.

You can check how much heap is allocated on your device if you select Blokada’s settings - Ad blocking - Ad blocking Settings - List status .
Here you also can see if a GC was done because then the number of possible entries increases.

If the number of enabled rules do not increase further you might select a list that entries are already included in another, previously enabled list or your device can’t load and keep more rules in memory.

1 Like