AdguardTeam / AdguardBrowserExtension

AdGuard browser extension
https://adguard.com/
GNU General Public License v3.0
3k stars 321 forks source link

Optimize memory usage #1324

Closed seba2282 closed 3 years ago

seba2282 commented 5 years ago

It is specific problem. First configuration, when I turn on filters in blocker, is moment when Adguard crash and stop working, after then I have monit on site in polish "kurza twarz" and information about crash adguard. I don't know, it is bug in Adguard 3 or what, but in older version 2.x any bug. On Android version 3 crashed too, how was in beta. When I used channel before beta (I forgort what named), next version works normally.

ameshkov commented 5 years ago

@seba2282 we need more info:

  1. Browser and it's version
  2. Exact steps to reproduce
seba2282 commented 5 years ago
  1. Firefox and Chrome has a problem (both newest version) and extension version first from v3 (3.0.8)
  2. Second - don't understand too end. I turn on filters and is moment in first configuration Adguard when extension stop works and on Firefox all browser stop work, on chrome is monit about "kurza twarz" and Adguard crashed. On Android first version 3.0 (in beta channel) restarted all app with turn off in first configurations with adding filters. Interesting fact unstable channel daily on Android works normally.
seba2282 commented 5 years ago

After Windows update from yesterday like is calming in browser extension on Windows, but on Firefox Android extension still when I try configure with adding filters, all browser turn off. It isn't good with that extension. I wait on fast fix on that. Temporary use Adguard Android with Firefox (without premium options).

ameshkov commented 5 years ago

So from what I understand, Firefox for Android crashes when too many filter lists are enabled in AdGuard. We should reproduce this on our side @zebrum .

seba2282 commented 5 years ago

@ameshkov, AG extension 3.11 still make Firefox Android turn off for me. What about fix?

ameshkov commented 5 years ago

@seba2282 it's assigned to v3.1. Meanwhile, you should not enable all filters.

seba2282 commented 5 years ago

@ameshkov, thank you for information.

maximtop commented 5 years ago

@seba2282 Does use optimized filters setting turned off or on on your phone? I've checked on my phone and found out that if this setting is turned off firefox for android crashes with error out of memory on the approximately 300000 - 400000 rules.

seba2282 commented 5 years ago

I used optimized for filters and without that and still restart all Firefox on my Huawei P8 Lite (2015). So I temporary turned off Adguard Extension in Firefox for waiting fix and installed other extension Adblocker in Firefox. I don't know why AG make me that situation if Wifi works good, internet really fast, only problem in Firefox. I remember, one version Android App from 3x versions made me reset all Adguard App and options all reset in that app, what I choosed. After was next version 3x App and works good.

seba2282 commented 5 years ago

@maximtop @ameshkov, I on moment turned off extension in Firefox Android with waiting for fix and installed Adguard app. I will not leave Adguard. I see, Adguard is a future in blocking ads. Any extension for old Edge works good, without Adguard. That works really great. Only problem with player.pl and anti adblock informations. So for Windows and Android I stay with Adguard products.

seba2282 commented 5 years ago

@ameshkov, is fix for problem? I will test if is. 😁

ameshkov commented 5 years ago

There will be no immediate changes. The real memory usage optimization is planned for the future, and it will take quite some time. Also, I am waiting for Chrome to release the dev preview of manifest v3 before doing anything.

Now about this issue:

  1. The memory usage of v3.0 is absolutely the same as of v2.10, it's easy to check if you grab the old version on Github: https://uploads.adguard.com/up04_idptj_Task_Manager_-_Google_Chrome.png
  2. The only quick fix that can be done is limiting the number of filtering rules, and this is not okay as well.
  3. You should not enable so many filter lists.
seba2282 commented 5 years ago

I don't know, why version 2x didn't problematic like version 3x. So I try that new version first after eventually I install version 2x. But still wait for works with mine settings turn. Like works v2x

seba2282 commented 5 years ago

After my tested on Firefox Windows with Adguard extension, I guess can be problem after Mozilla site. 4GB Ram on Laptop and when I configure AG extension, is moment when Mozilla use much RAM and can't make nothing. Interesting fact is chromium. That works fine. On old Edge make few ram much used but I waited and slower configured and Edge calmed. I still won't leave AG - extension is turned off on that moment and use app Android. On laptop try Firefox still and Extension AG.

erkinalp commented 5 years ago

It already slows down the browser considerably, if we cut down the memory footprint, it would have to be even slower.

seba2282 commented 5 years ago

@erkinalp, I don't agee with you to end? Why UBO/NANO ADBLOCKER can have much filters and work fast and not consumpt memory much like make Adguard extension?

erkinalp commented 5 years ago

I assumed same overall complexity. UBO is much simpler and it does not have auto-enabling filters et al.

seba2282 commented 5 years ago

@erkinalp, But seriously Adguard need optimize ram. Should works faster as extension. If I use all bundled filters in UBO and in Adguard, then browser with UBO works fast, browser with Adguard slower.