Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

HTTPS Everywhere uses too much memory #1775

Closed

Description

@bcroq

Member note: One straightforward fix for this is described here (issue comment), along with an example PR in the Firefox codebase

I use HTTPS Everywhere Chrome 43.0.2357.65 (64-bit Linux) and the extension eats a little more than 100MB of memory. Isn't it too much for this kind of extension?

Activity

  1. reedy commented on May 27, 2015

    @reedy
    Contributor

    What do you mean by "this kind of extension"?

    Noting the raw XML rulesets totalling 62M

  2. bcroq commented on May 27, 2015

    @bcroq
    Author

    When I wrote "this kind of extension" I had uBlock in mind. This extension has 53869 filters on my computer and uses 68MB of memory.

  3. jsha commented on May 27, 2015

    @jsha
    Member

    @bcrow: Yes, my gut feeling is that HTTPS Everywhere can and should be optimized for better memory and CPU use. We haven't had the time to do it yet, but would very much welcome help from someone who is experienced at profiling extensions.

    The uBlock number you quote is actually encouraging! HTTPS Everywhere has 14.5k 'rulesets', but each ruleset contains many targets and rules, which are presumably more akin to uBlock's filters. There are 39361 rules and 41287 targets, for a total of ~80k entities. The memory usage for those entities sounds proportional to uBlock, which is a surprise to me. Still, we can probably do a better job of keeping inactive rulesets out of memory.

  4. foresto commented on Jun 13, 2015

    @foresto

    For the record, this is not a Chrome-specific issue. It might be worth editing the title of this report accordingly.

    In my Firefox profile, HTTPS Everywhere 5.0.5 is using almost seven times as much memory as uBlock Origin 0.9.8.2.

  5. changed the title [-]Does HTTPS Everywhere takes too much memory on Chrome?[/-] [+]HTTPS Everywhere uses too much memory[/+] on Jun 17, 2015
  6. jsantell commented on Jun 18, 2015

    @jsantell

    Scoping this out for Firefox, will report back what I find

  7. imdjh commented on Aug 11, 2015

    @imdjh

    Taking 100+ MiB memory upon opening only the 'New Tab'(which is taken ~70 MiB).
    FYI: 44.0.2403.89 chromium on Debian 8.1, installed this via chrome webstore, this.version: 2015.7.17

  8. widefox commented on Aug 28, 2015

    @widefox

    Agree uBlock has shown the way forward to reduce memory usage. Can we get this prioritised?

  9. stokito commented on Sep 22, 2015

    @stokito

    Maybe it is possible to make online service API and make pre-request to fetch a rule?
    Also it may be a small cache for last used domains.

  10. txtsd commented on Sep 22, 2015

    @txtsd

    It would really help if this issue were prioritized. HTTPS Everywhere uses more RAM than any of my tabs or extensions on Chrome.

    chrome task manager

  11. jaens commented on Oct 1, 2015

    @jaens

    200M memory usage, this is getting a bit excessive.

  12. jaens commented on Oct 1, 2015

    @jaens

    I took a look at the heap snapshot, it's about 40MB, mostly going into the RuleSet objects. I think this could be reduced by:

    • Not using RegExp objects unless necessary (as they use more memory than strings, especially if they are JIT-compiled).
    • Not creating empty arrays in the rulesets, as these always consume heap (just set the collection to null when there are no entries).

    There's probably value in reducing the peak memory usage as well by caching the parsed XML as JSON, so the heap wouldn't be oversized on startup.

  13. txtsd commented on Oct 1, 2015

    @txtsd

    @jsha Is there any way you can elevate or prioritize this issue? I get that RAM isn't a problem for most people, but a lot of us still use old hardware with not that much RAM.

  14. Immortalin commented on Oct 2, 2015

    @Immortalin

    @txtsd I concur with your point. Doing any form of Clojure web development while using Chrome is close to impossible due to high memory consumption. And this a 4GB ram machine.

  15. blockoperation commented on Oct 6, 2015

    @blockoperation

    I was bored and had a go at doing some of these optimizations myself (blockoperation/https-everywhere@master...blockoperation:chromium-memory-usage).

    This catches the really obvious cases (i.e. "^http:" for "from" in rules, cookie name patterns that match everything, etc), and almost halves the number of regexes on my setup (I tested these changes on the latest release in the web store, so the effect may be more or less with up to date rules) and reduces the heap snapshot by several MB.

  16. 62 remaining items

  17. removed their assignment
    on May 4, 2017
  18. crogonint commented on May 5, 2017

    @crogonint
  19. taylorkline commented on May 17, 2017

    @taylorkline
    Contributor

    @jsha You edited the first post to state "Member note: One straightforward fix for this is described at #1775 (comment), along with an example PR in the Firefox codebase" but the hyperlink to the comment is not valid; it just hyperlinks back to this issue.

  20. jsha commented on May 17, 2017

    @jsha
    Member

    Thanks for pointing that out; I've re-edited to fix the link.

  21. genbtc commented on Jun 6, 2017

    @genbtc

    I just noticed this, its still affecting me. What a mess. Can we please fix this? I Looked into the Chrome Memory tab snapshot thing and couldnt really find the source of it. It just seems like its wasteful with arrays, and with duplication of the same stuff in memory multiple times.

    Can we get an official declaration on what needs to be done at this point in time please? I can lend my skills to extension editing.

  22. techtonik commented on Aug 25, 2017

    @techtonik
    Contributor

    This thread needs to be reticketed with a list of possible solutions if someone still wants to fix the problem.

  23. deleted a comment from monstertruckpa on Aug 25, 2017
  24. deleted a comment from monstertruckpa on Aug 25, 2017
  25. locked and limited conversation to collaborators on Aug 25, 2017
  26. gloomy-ghost commented on Nov 3, 2017

    @gloomy-ghost
    Collaborator

    Close in favour of #12232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions