GithubHelp home page GithubHelp logo

Comments (234)

gorhill avatar gorhill commented on June 21, 2024

Yes that would be nice, it seems people like it, more than I expected (given that it doesn't do all what ABP currently does -- like manually blocking elements, or entering URL to lists). I am currently quite loaded, and there are still important issues in need of fixing with HTTPSB.

Learning a whole new API is very time consuming. Even with the chrome API I can spend a while trying to figure why something unexpected is happening (as happened yesterday), so let alone a new one.

What would be nice is an angel developer doing some leg works to port to Firefox, and I could do my part in splitting more the platform specific stuff out of the core code as per feedback, etc. Eventually both projects could be merged.

from ublock.

entepe85 avatar entepe85 commented on June 21, 2024

I'd generally second this request, even though I can't be of great help for a port since I unfortunately know close to nothing about extension development. Would love to have this great extension in Firefox nevertheless.

from ublock.

 avatar commented on June 21, 2024

I wonder if it'd be helpful to split out various "bite-size" chunks of work and add them as specially tagged issues in here.

from ublock.

gorhill avatar gorhill commented on June 21, 2024
  • Skeleton framework
    • Where to hook net request handling?
    • Where to hook initialisation?
    • Where to save/restore data?
    • Are core, content scripts, popup and dashboard page all in separate contexts? If yes:
      • What messaging infrastructure FF provides?
  • Initialization of the core
    • Reading user settings (which lists are selected etc.)
    • Loading, parsing the lists, storing the filters
  • Intercepting net request and potentially cancel them as per filters
  • Local mirroring
  • Pop-up blocking
  • Content-scripts
    • Element picker
    • Cosmetic filtering
  • Infrastructure to update updatable assets
  • Popup menu
  • Dashboard

from ublock.

robsalasco avatar robsalasco commented on June 21, 2024

+1

from ublock.

maikelswe avatar maikelswe commented on June 21, 2024

+1 for a FF version sorry I can´t help with it, i´m a Cisco guy not a programmer

from ublock.

Ahriman avatar Ahriman commented on June 21, 2024

Please make a version for FF :D thanks!

from ublock.

WyohKnott avatar WyohKnott commented on June 21, 2024

This would be great indeed, I'm using Bluhell Firefox on Firefox currently but it has limited functions.

If anyone wants to start, here's the list of relevant hooks https://developer.mozilla.org/en/docs/Observer_Notifications#HTTP_requests
to use with https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/system_events

from ublock.

alekksander avatar alekksander commented on June 21, 2024

+1

from ublock.

Kyuzial avatar Kyuzial commented on June 21, 2024

Yes please do a firefox version there isn't one good adblocker on firefox Please :'(

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

uBlock.xpi

Update:
Newer builds can be downloaded from the releases section.

from ublock.

my-password-is-password avatar my-password-is-password commented on June 21, 2024

Cool. Testing it out.

When I restore from a file the options in the "Settings" and "Statistics" tabs doesn't restore. Same happens when you try resetting to default.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@Deathamns Wow, this is awesome.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

Among first thing I tried, the VIM Color Scheme Test (which originally is why I decided to start uBlock):

From Mozilla dev re. VIM test vs. ABP:

According to about:memory, window-objects->layout->style-sets is the epicenter of the usage (jumping about 1 GB)

So I just looked:

  • uBlock + default filter lists [1]: window-objects->layout->style-sets = 49 MB.
  • ABP + filter lists in [1]: window-objects->layout->style-sets = 1,565 MB.
  • No blocker: window-objects->layout->style-sets = 49 MB.

  • [1] Default filter lists:
    • EasyList
    • Peter Lowe's Ad server list
    • EasyPrivacy
    • Fanboy's Social Blocking List
    • Malware domain lists

from ublock.

alekksander avatar alekksander commented on June 21, 2024

"Show the number of blocked requests on the icon" is not remembered upon restart.
0.8.2.0 is the version shown in add-ons manager, and 0.7.2.0 is shown in addon menu.
beside that, after several minutes of testing - brilliant! thank You again Deathamns!

from ublock.

gorhill avatar gorhill commented on June 21, 2024

Another thing to look into, is that blocking inline javascript specifically does not seem to work: Test page. Is it a limitation of Firefox re. Content Security Policy? Never mind, I see onHeaderReceived has not been implemented yet.

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

This is just an early preview, still implementing the basics. I'm not even sure if reporting issues at this point is necessary. I just wanted to show what I was working on, and what can be expected for Firefox, but it's definitely not ready.

@my-password-is-password @alekksander You're probably talking about the same problem, which I was aware of.

@gorhill For me, ABP freezes the whole browser with 1GB+ RAM usage on the VIM page, I have to kill the process. However, there's no problem with µBlock, so my testing stopped here.
(By the way, your links to both the VIM Color Scheme Test (wrong link) and why (extra slash) are broken.)

As I said, some things are still missing, for example blocking inline scripts or pop-ups, experimental features, context menu, and there are bugs too, like the pop-up doesn't hide when a link is opened from it, or settings don't save in some cases (above mentioned)...

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@Deathamns

This is just an early preview, still implementing the basics.

Understood. Issues should be filed once you decide it's ready for this. It works pretty well overall already. One thing is for sure: this is a huge milestone. Such a nice thing to see first thing this morning. Thank you very much for your work on portability and now the Firefox port a whole lot of people are waiting for.

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

I'm curious about one thing though. There is a constant crash in e10s enabled Nightly.
After the extension is installed, restart the browser and all tabs will crash because of the extension. However, if I disable the extension, and enable it (via the Add-ons Manger, without restarting the browser), then It will work normally. Can someone confirm this?

from ublock.

harshanvn avatar harshanvn commented on June 21, 2024

Maybe file a bug at bugzilla?
e10s are not working for me with yesterday's build. Getting a black page. Will update tonight and see if I can test this in e10s.
Congratulations for huge milestone. Soon I will be start using Firefox again.:)

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

A crash report about this issue was created earlier, and if anyone wants to confirm it, here is the thread.

from ublock.

JBey4you avatar JBey4you commented on June 21, 2024

Thanks for this @Deathamns, really appreciate your effort!

I was wondering: is the difference between Adblock Plus - uBlock is as important on Firefox, compared to Chrome? (I know it's still an early version, so improvements can be made.)

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@JBey4you never mind my previous post, actually I am not sure what you are asking.

from ublock.

JBey4you avatar JBey4you commented on June 21, 2024

@gorhill Your previous post was actually what I was looking for. ;-) I'm just wondering if the difference between Adblock Plus and uBlock is as good as the one on Chrome. Something like this (found on your wiki)

gorhill edit: replaced pic with link to wiki

from ublock.

gorhill avatar gorhill commented on June 21, 2024

Your previous post was actually what I was looking for

Oh ok, so I will post something concrete soon. All done manually (though very carefully), as I don't have my benchmark tool on Firefox.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

Moved benchmark results to "Firefox version: benchmarking memory footprint of the early preview"

from ublock.

JBey4you avatar JBey4you commented on June 21, 2024

So it's positive, great! Firefox seems "heavy" sometimes, I'm sure uBlock will be helpful now.

from ublock.

HubJ avatar HubJ commented on June 21, 2024

On Firefox 24-8-1 ESR, the attempt to install uBlock.xpi from the link above fails with the message: "The add-on downloaded from GitHub.com could not be installed because it is not compatible with Firefox 24.8.1."

from ublock.

0xBRM avatar 0xBRM commented on June 21, 2024

How about using this as well? https://addons.mozilla.org/en-us/firefox/addon/about-addons-memory/ It'd make it easier to measure the performance of one extension compared to the other, statistically.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@CrisBRM One of the thing that I had a harder time to show with Chromium, and which I believe is the more important figure, is the extension's own memory footprint PLUS contributed memory footprint to web pages, because with Chromium everything is in its own process, I would have had to manually collate and sum the figures (meh). With Firefox however, being single-tasked, I can do it easily above without requiring any special tool.

I do not doubt that uBlock itself is leaner than ABP, including in the long run, I've seen enough of ABP's code to know that unless they refactor, it just can't match uBlock for own memory footprint.

However the biggest improvement uBlock's brings relative to ABP is the significantly smaller contributed memory footprint to web pages (see results above): would about-addon-memory help to report this contributed memory footprint to web pages as well?

from ublock.

0xBRM avatar 0xBRM commented on June 21, 2024

It would not (because as the name implies it reports the memory used by the addons only) and you're right about that, but relative performance of each extension is a better measurement of how well optimised it is, especially due to how terrible ABP's cache implementation is.

On a side note, regarding your comment on Chrom* based browsers, you don't have to sum the figures of each individual process, just go to chrome://memory.

from ublock.

0xBRM avatar 0xBRM commented on June 21, 2024

Installed firefox and tried to do the same and got similar results, probably because the extensions gets the numbers from firefox's about:memory page, under "extensions", using the extension's ID. I confirmed this and it's the same number as the one being reported by the extension.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

under "extensions", using the extension's ID

Actually, using about:memory, I get:

ABP: 36.3 MB
uBlock: 7.09 MB

│   ├──36.30 MB (17.41%) ++ {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0x7fab8615d000)/compartment([System Principal], jar:file:///home/rhill/.mozilla/firefox/mwad0hks.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js (from: resource://gre/modules/addons/XPIProvider.jsm:4176))
│   ├───7.09 MB (03.40%) ++ {2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}
│   └───0.24 MB (00.12%) ++ [email protected]/js-non-window/zones/zone(0x7fab8615d000)

I suspect about:addons-memory is not fetching the proper entry for uBlock because it was not installed from the store. Still, 7 MB vs. 36 MB is an even better ratio than what's I've seen on Chromium (roughly it uBlock has been 50% of ABP for Chromium).

from ublock.

0xBRM avatar 0xBRM commented on June 21, 2024

It's worth noting that I only tried that with ABP and gave up before installing uBlock, but yes, that's even greater. This has just been featured on ghacks.

from ublock.

greduan avatar greduan commented on June 21, 2024

Is the source for the port available outside of the .xpi? I.e. in GitHub or something similar?

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

@HubJ It's compatible from Firefox 29. Developing Firefox extensions in not a pleasant experience (in my opinion), especially supporting older versions, so I decided not to make any effort to support them. Someone else has to do it (if it's needed).

@CrisBRM @gorhill about:addons-memory is not helpful in case of µBlock.
Those numbers only show how much the content scripts use (not sure if the stylesheets are included).

@greduan Here.

from ublock.

JBey4you avatar JBey4you commented on June 21, 2024

@Deathamns : I do not want to rush you at all, but I'm wondering if you have an idea for a potential date for the final version?

I'm testing the .xpi found here right, and it seems pretty stable to be honest.

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

from ublock.

Dimas-sc avatar Dimas-sc commented on June 21, 2024

Is it normal to view the interface in ... oriental language? http://i.imgur.com/QTWBWTe.png + http://i.imgur.com/HijXCdr.png

from ublock.

logos88 avatar logos88 commented on June 21, 2024

Great work! Just the only extension that Firefox was lacking!! :)

It would be interesting not only a MB comparison, but a CPU consumption too.

from ublock.

0xBRM avatar 0xBRM commented on June 21, 2024

@logos88 oh, I'm sure Raymond won't miss out on an opportunity to publically humiliate Palant again, so don't you worry about that.

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

@Dimas-sc Open the Web Console (Menu/Tools/Web Developer/Web Console or Ctrl+Shift+I or F12) on the Options page, and in the Console tab, type and run this: console.log(navigator.language)
Copy-paste the result here.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@CrisBRM Benchmarking is never about humiliating -- that is not my state of mind, it's about having hard data from which to work on for the project's own benefits -- as stated on the first page, "development through benchmarking". Of course using benchmark results to also compare to existing solutions out there is expected in software development. Benchmarks/becnhmark results can be disputed, but this better be done in an intellectually honest manner, or else risk look foolish.

from ublock.

Dimas-sc avatar Dimas-sc commented on June 21, 2024

12:57:31.943 console.log(navigator.language);
12:57:31.947 undefined

But the locale of my browser is the catalan (ca)

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

I should have said to write only navigator.language, because console.log gives an extra undefined line before the result. So, you should see a "ca" too under the undefined line.

I thought that your problem is that the language you see is not right-to-left oriented, but now I see that the problem simply that English is not used as default language. OK, will be fixed.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

I have added Chromium results in the benchmark results above. Interesting to compare both browsers.

from ublock.

ThePurpleCrayon avatar ThePurpleCrayon commented on June 21, 2024

I installed uBlock, disabled AdBlock Plus, disabled Ghostery & disabled my hosts file.
Within uBlock, I disabled & purged all filters and copied my hosts file contents within uBlock
-all 949,973 entries...
I am running Waterfox 33.0.2 with 7 extensions and 6 user scripts enabled.....Holy Shit!
Can I say Holy Shit!? The browser is running like a first install, with uBlock blocking everything that all the other elements combined were blocking previously.

What do you want for Christmas? This is the .xpi of the century!

from ublock.

gorhill avatar gorhill commented on June 21, 2024

copied my hosts file contents within uBlock all 949,973 entries...

Ah yes, uBlock is specially optimized for hostname-only based filters, because that part of the code came from HTTP Switchboard, and it had to be highly optimized as the evaluation of a net request against a dictionary of 70,000 hostnames (the sum of entries in most common hosts files) had to be lightning fast. Happy to hear it still work fine with 950K entries.

The launch speed should be even better once uBlock makes a selfie of itself (occurs automatically after a while when no change to filter lists), this will allow skipping the parsing of the raw filters next time uBlock launches.

from ublock.

fhoshino avatar fhoshino commented on June 21, 2024

The nightly release of ublock is blazing fast compared w/ abp.
Thank you for just porting this extension I'm long waiting while I'm using chrome.

Though I've a problem of memory leak with windows x64 nightly firefox.
I have a few javascript heavy tabs (facebook, twitter, plurk, google+, gmail)
The memory usage surge up to 2.3gb on my config.
I'm capped on 1.5gb with the same config w/ abp.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

I have a few javascript heavy tabs (facebook, twitter, plurk, google+, gmail)
The memory usage surge up to 2.3gb on my config.
I'm capped on 1.5gb with the same config w/ abp.

I tested your scenario, using Firefox 34 64-bit + uBlock + default filter lists.

I opened the pages you list (on top of the ones I had already opened), and played with the contents to force the pages to do some work (scrolling down to force new content to be loaded, changing DOM tabs, etc.). Eventually I opened about:memory, GC'd/CC'd/Minimized[1] and "Explicit allocations" was at 695 MB. Then I closed all the above web pages, forced a GC/CC/Minimize, and memory went down to 291 MB (w/ uBlock at 8 MB).

So, could this be specific to Firefox Nightly? (Though I suppose it is possible an early preview version could have memory leaks).

[1] does FF do this automatically at some point during idle time? (I am assuming yes)

from ublock.

DomT4 avatar DomT4 commented on June 21, 2024

uBlock.xpi

@Deathamns I can't seem to get the link to open for me. Just keep bumping into an interrupted connection. Is the .xpi anywhere else?

from ublock.

fhoshino avatar fhoshino commented on June 21, 2024

@gorhill Firefox would have auto GC I guess, but I'm a heavy user and I don't have much idle time for it, and I don't open about:memory to do a manual GC while I'm working with it.
I'll try to get you some stats with my config.

from ublock.

DomT4 avatar DomT4 commented on June 21, 2024

I can't seem to get @Deathamns's fork to build using the scripts provided. I'm probably just being a moron though. Here's the bug if its useful:

*** uBlock_xpi: Copying files
rm: dist/build/uBlock_xpi: No such file or directory
*** uBlock_xpi: Generating meta...
Traceback (most recent call last):
  File "tools/make-firefox-meta.py", line 29, in <module>
    with open(locale_path, encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function

I'm not doing anything particularly whack with my locale setting:

LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

@DomT4 I don't see any problem with the link. Try downloading it through a proxy.
Also, you need Python 3 to build for Firefox.

from ublock.

fhoshino avatar fhoshino commented on June 21, 2024

Here are some stats from a half hour heavy browsing session.
http://pastebin.com/9frb0YZz

This is my config
http://pastebin.com/PYbMa8jk

from ublock.

DomT4 avatar DomT4 commented on June 21, 2024

@Deathamns Turns out I'm an idiot and googledrive.com somehow ended up on my hosts list. Oops.

Also, you need Python 3 to build for Firefox.

I have both Python3 and Python on the system, both updated to the latest versions.

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

Then probably it tries to run it through Python 2, maybe that is your default.

from ublock.

DomT4 avatar DomT4 commented on June 21, 2024

Hit the same error if I do python3 make-firefox-meta.py. Hit the same error with the Safari script FWIW.

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

Try adding the following line to the beginning of the .py files: from io import open

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@fhoshino I ran a session for just https://plus.google.com (which was a top mem consumer in your log), first with ABP, then with uBlock. Loaded https://plus.google.com in one tab, slowly hit Page Down 50 times, hit Home. Then I opened about:memory, GC/CC/Minimized, then save measurements to a file. Then I loaded the diff of the two result sets (see below).

Negative figures is the extra amount ABP used over uBlock. Positive is the extra amount of memory uBlock used over ABP.

What this shows is that with the page at https://plus.google.com the browser does uses 83 MB less memory with uBlock than with ABP (for just that one page, after having interacted with as per above steps). In what you posted on pastebin, I can see an orphaned branch (464.93 MB ... top(none)), which I believe is memory which would be reclaimed at some point. Your mem footprint for https://plus.google.com was double that on mine.

Now I don't have Nightly, but so far since I can't reproduce the hight memory footprint with FF34, it points to the possibility that the problem is specific to Nightly?

-83.76 MB (100.0%) -- explicit
├──-27.99 MB (33.42%) -- add-ons
│  ├──-37.12 MB (44.32%) ++ {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0xNNN)/compartment([System Principal], jar:file:///home/rhill/.mozilla/firefox/mwad0hks.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js (from: resource://gre/modules/addons/XPIProvider.jsm:4176))
│  └────9.13 MB (-10.91%) ++ {2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}
├──-26.82 MB (32.02%) ++ js-non-window
├───-4.15 MB (04.96%) ++ images
├──-15.54 MB (18.56%) ── layout/style-sheet-service
├────1.49 MB (-1.78%) -- window-objects
│    ├──13.06 MB (-15.59%) ++ top(resource://gre-resources/hiddenWindow.html, id=1)
│    ├──-12.13 MB (14.49%) ++ top(https://plus.google.com/, id=8)
│    ├──-1.16 MB (01.39%) ++ top(about:newtab, id=73)
│    ├──1.16 MB (-1.39%) ++ top(about:newtab, id=77)
│    ├──0.87 MB (-1.03%) ++ top(about:memory, id=23)
│    ├──-0.84 MB (01.01%) ++ top(about:memory, id=19)
│    └──0.54 MB (-0.65%) ++ (4 tiny)
├───-6.41 MB (07.66%) ── heap-unclassified
├───-2.41 MB (02.88%) ── atom-tables/main
├───-0.67 MB (00.79%) -- heap-overhead
│   ├───1.01 MB (-1.21%) ── page-cache
│   ├──-0.92 MB (01.10%) ── bin-unused
│   └──-0.75 MB (00.90%) ++ (2 tiny)
├───-0.89 MB (01.06%) ++ network
└───-0.36 MB (00.43%) ++ (11 tiny)

from ublock.

DomT4 avatar DomT4 commented on June 21, 2024

Try adding the following line to the beginning of the .py files: from io import open

That replaces the old error with a new one:

*** uBlock_xpi: Generating meta...
Traceback (most recent call last):
  File "tools/make-firefox-meta.py", line 46, in <module>
    f.write('=')
TypeError: must be unicode, not str

from ublock.

 avatar commented on June 21, 2024

I just discovered the uBlock project via gHacks. Seems very promising. I'm committed to Firefox and AdBlock Plus/Edge together with Policeman. Having with uBlock the advantages of Adblock without its disadvantages is exciting to put it mildly. And I'm not the only one to believe so : Adblock users are, need to say, numerous. uBlock is on a highway.

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

@DomT4 I just tried with Python 2, and got the same error, so you're clearly running it through Python 2, since it works works fine with 3.
But, you can make it work. Add a letter u before every string that is passed to f.write() (lines: 46, 48, 54, 58)
For example: f.write('=') to f.write(u'=')

from ublock.

fhoshino avatar fhoshino commented on June 21, 2024

I still can produce the memleak in 34.0.5 x64
http://pastebin.com/114CVXCk

from ublock.

sxe avatar sxe commented on June 21, 2024

I built a PKGBUILD for archlinux, which checks out the latest git version and installs it globally for all firefox profiles: https://aur.archlinux.org/packages/firefox-extension-ublock-git/

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@fhoshino Quick analysis:

There is 578 MB waiting to be GC'd, so real memory footprint is 1,260 MB.

You have 19 tabs opened, using 446 MB. This leaves 814 MB which need to be identified.

The next largest contributors are: something called js-non-window (370 MB), heap-unclassified (126 MB), heap-overhead (108 MB), images (83 MB), etc.

I see uBlock is reported with a mem footprint of 40 MB, which does seem reasonable given you have 19 tabs opened. The thing to see really is if that 40 MB goes back to ~10 MB if you close the tabs.

I am not familiar yet with all things memory re. Firefox, but so far I don't see anything that catch my attention as being very wrong in there. This time the mem footprint for your plus.google.com page is more in line with what I've reported above.

In short, I don't really see what you call a "memleak" with your log. A mem leak is when the memory doesn't snap back to baseline after you close all but one empty web page (you have 19 of them opened as per log.) It has also to be shown that whatever the result is, it is different from when using whatever other alternative extension with rigorously the same steps.

The only way to support the case of a memory leak is to have at least two scenarios for one rigorous benchmark, one of which is the control scenario. The benchmark must have exact and detailed steps. I can't emphasize exact enough. Just opening a popup UI for an extension will increase memory footprint. Then once scenarios are complete, gather results. A third scenario can be added to also compare against an alternative (say ABP).

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@sxe maybe it should be noted it's not a final version, only an early preview, so as to not create false expectations.

from ublock.

sxe avatar sxe commented on June 21, 2024

@gorhill I added TESTVERSION to the package description. Even that is against the guidelines, so i guess that's all i can do. Besides that, it is a git package so users should be aware that it is a development version. If you prefer to not have the package online i will remove it of course.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@sxe I don't mind at all, the opposite actually, the early preview works well enough already. It's more for @Deathamns, I wouldn't want him to be swamped with lots of issues being opened while he is well aware of all that is left to add/fix.

from ublock.

sxe avatar sxe commented on June 21, 2024

@gorhill i agree. So i will keep it up. I can remove if necessary.

from ublock.

fhoshino avatar fhoshino commented on June 21, 2024

@gorhill is there a memory usage heavy benchmark I can use for?
I'd like to test it out.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@fhoshino I have my benchmark tool I wrote for Chromium, but since I'm a newbie to Firefox addon framework, I don't know what's out there for FF.

from ublock.

DomT4 avatar DomT4 commented on June 21, 2024

@Deathamns Your commit here seems to have fixed it for me, but I was definitely using Python3 previously:

screen shot 2014-12-20 at 17 59 21

/usr/bin/env Python3 -V
Python 3.4.2

Edit - Just for fun though, that commit also broke things for me until I changed /usr/bin/python3 back to /usr/bin/env python3 due to my python3 not living in /usr 😉

from ublock.

gorhill avatar gorhill commented on June 21, 2024

I re-did the test for Chromium with click-to-play, as the Flash video which were playing during the test ended up creating a lot drowning memory usage noise. If somebody can tell me how to have click-to-play on Firefox, that would be nice, I just can't find it.

from ublock.

r-a-y avatar r-a-y commented on June 21, 2024

If somebody can tell me how to have click-to-play on Firefox, that would be nice, I just can't find it.

Go to about:addons, click on the "Plugins" tab, go to "Shockwave Flash" and select "Ask to Activate".

from ublock.

gorhill avatar gorhill commented on June 21, 2024

I did that, it did not work, the video on Yahoo news kept playing every time. Now I just found out it seems to work... Whatever, now I can redo the tests.

All rights all test redone. Will move this to a wiki page eventually.

from ublock.

stevenwu avatar stevenwu commented on June 21, 2024

Mac Firefox 34.0.5. I'm also getting these memory leaks / ghost windows. Freeing memory manually in about:memory does not clean up these windows. Issue is not present with ABP.

├──21.55 MB (07.08%) -- top(none)/ghost/window(https://twitter.com/)
│   │  ├──12.61 MB (04.14%) -- js-compartment(https://twitter.com/)
│   │  │  ├──11.78 MB (03.87%) -- classes
│   │  │  │  ├───6.03 MB (01.98%) -- class(Object)
│   │  │  │  │   ├──3.28 MB (01.08%) ++ objects
│   │  │  │  │   └──2.74 MB (00.90%) ++ shapes
│   │  │  │  └───5.76 MB (01.89%) ++ (7 tiny)
│   │  │  └───0.83 MB (00.27%) ++ (4 tiny)
│   │  ├───4.56 MB (01.50%) ++ dom
│   │  ├───4.29 MB (01.41%) ── style-sheets
│   │  └───0.10 MB (00.03%) ── property-tables

from ublock.

gorhill avatar gorhill commented on June 21, 2024

Issue is not present with ABP

Yes it is. It appears to be normal functioning of the browser. Ok what I see with ABP is rather top(none)/detached.

from ublock.

Betsy25 avatar Betsy25 commented on June 21, 2024

@everyone Where can I get uBlock for Firefox ?
I hear people talk about it but cannot find it ? :§(

from ublock.

stevenwu avatar stevenwu commented on June 21, 2024

It's not normal functioning. There are many extensions that will cause this though. I don't know if it's a Mac issue, but here's a test with all addons disabled. I visit twitter.com then close the tab.

├───32.81 MB (14.79%) -- window-objects
│   ├──19.68 MB (08.87%) -- top(none)/detached
│   │  ├──19.23 MB (08.67%) -- window(https://twitter.com/)
│   │  │  ├──12.30 MB (05.54%) -- js-compartment(https://twitter.com/)
│   │  │  │  ├──11.37 MB (05.12%) -- classes
│   │  │  │  │  ├───5.32 MB (02.40%) -- class(Object)
│   │  │  │  │  │   ├──3.35 MB (01.51%) -- objects
│   │  │  │  │  │   │  ├──2.33 MB (01.05%) ── gc-heap
│   │  │  │  │  │   │  └──1.03 MB (00.46%) ++ malloc-heap
│   │  │  │  │  │   └──1.96 MB (00.89%) ++ shapes
│   │  │  │  │  ├───3.21 MB (01.45%) ++ (8 tiny)
│   │  │  │  │  └───2.84 MB (01.28%) ++ class(Function)
│   │  │  │  └───0.93 MB (00.42%) ++ (5 tiny)
│   │  │  ├───4.28 MB (01.93%) ── style-sheets
│   │  │  ├───2.60 MB (01.17%) ++ dom
│   │  │  └───0.05 MB (00.02%) ── property-tables
│   │  └───0.46 MB (00.21%) ++ window(about:blank)
│   ├───7.10 MB (03.20%) -- top(chrome://browser/content/browser.xul, id=5)
│   │   ├──6.17 MB (02.78%) -- active
│   │   │  ├──6.05 MB (02.73%) -- window(chrome://browser/content/browser.xul)
│   │   │  │  ├──3.63 MB (01.64%) ++ (4 tiny)
│   │   │  │  └──2.42 MB (01.09%) ++ js-compartment([System Principal], about:blank)
│   │   │  └──0.12 MB (00.05%) ++ window(about:blank)
│   │   └──0.92 MB (00.42%) ++ js-zone(0x1184ca000)
│   ├───3.18 MB (01.44%) ++ (4 tiny)
│   └───2.84 MB (01.28%) -- top(chrome://browser/content/hiddenWindow.xul, id=1)
│       ├──2.54 MB (01.14%) ++ active
│       └──0.31 MB (00.14%) ++ js-zone(0x10e563000)

Perform 'minimize memory usage' in about:memory.

206.69 MB (100.0%) -- explicit
├───76.83 MB (37.17%) ── heap-unclassified
├───55.64 MB (26.92%) -- js-non-window
│   ├──31.93 MB (15.45%) -- zones
│   │  ├──29.78 MB (14.41%) -- zone(0x107aad800)
│   │  │  ├──22.22 MB (10.75%) ++ (207 tiny)
│   │  │  ├───4.98 MB (02.41%) -- compartment([System Principal], resource://gre/modules/TelemetryFile.jsm)
│   │  │  │   ├──4.87 MB (02.35%) -- classes
│   │  │  │   │  ├──4.62 MB (02.23%) -- class(Object)
│   │  │  │   │  │  ├──4.37 MB (02.11%) -- objects
│   │  │  │   │  │  │  ├──3.82 MB (01.85%) -- malloc-heap
│   │  │  │   │  │  │  │  ├──3.78 MB (01.83%) ── elements/non-asm.js
│   │  │  │   │  │  │  │  └──0.04 MB (00.02%) ── slots
│   │  │  │   │  │  │  └──0.55 MB (00.26%) ── gc-heap
│   │  │  │   │  │  └──0.25 MB (00.12%) ++ shapes
│   │  │  │   │  └──0.25 MB (00.12%) ++ (3 tiny)
│   │  │  │   └──0.11 MB (00.05%) ++ (3 tiny)
│   │  │  └───2.57 MB (01.25%) ── unused-gc-things
│   │  └───2.16 MB (01.04%) ++ (2 tiny)
│   ├──22.10 MB (10.69%) -- runtime
│   │  ├──14.47 MB (07.00%) -- gc
│   │  │  ├──14.00 MB (06.77%) ── nursery-committed
│   │  │  └───0.47 MB (00.23%) ++ (3 tiny)
│   │  ├───4.53 MB (02.19%) ── script-data
│   │  ├───2.10 MB (01.02%) ── atoms-table
│   │  └───1.00 MB (00.48%) ++ (10 tiny)
│   └───1.61 MB (00.78%) ++ gc-heap
├───33.49 MB (16.20%) -- window-objects
│   ├──22.16 MB (10.72%) -- top(about:memory, id=34)
│   │  ├──21.90 MB (10.59%) -- active/window(about:memory)
│   │  │  ├──20.24 MB (09.79%) -- dom
│   │  │  │  ├──19.78 MB (09.57%) ── orphan-nodes
│   │  │  │  └───0.47 MB (00.23%) ++ (5 tiny)
│   │  │  └───1.65 MB (00.80%) ++ (4 tiny)
│   │  └───0.26 MB (00.13%) ++ js-zone(0x11eec6800)
│   ├───6.98 MB (03.38%) -- top(chrome://browser/content/browser.xul, id=5)
│   │   ├──5.97 MB (02.89%) -- active
│   │   │  ├──5.85 MB (02.83%) -- window(chrome://browser/content/browser.xul)
│   │   │  │  ├──3.60 MB (01.74%) ++ (4 tiny)
│   │   │  │  └──2.25 MB (01.09%) ++ js-compartment([System Principal], about:blank)
│   │   │  └──0.12 MB (00.06%) ++ window(about:blank)
│   │   └──1.01 MB (00.49%) ++ js-zone(0x1184ca000)
│   ├───2.84 MB (01.37%) -- top(chrome://browser/content/hiddenWindow.xul, id=1)
│   │   ├──2.53 MB (01.23%) ++ active
│   │   └──0.31 MB (00.15%) ++ js-zone(0x10e563000)
│   └───1.51 MB (00.73%) ++ (3 tiny)
├───19.22 MB (09.30%) -- heap-overhead
│   ├──13.28 MB (06.43%) ── bin-unused
│   ├───3.89 MB (01.88%) ── page-cache
│   └───2.04 MB (00.99%) ++ (2 tiny)
├────7.50 MB (03.63%) ++ (17 tiny)
├────4.94 MB (02.39%) -- workers/workers(chrome)
│    ├──2.91 MB (01.41%) ++ worker(resource:///modules/sessionstore/SessionWorker.js, 0x116d96c00)
│    └──2.03 MB (00.98%) ++ worker(resource://gre/modules/osfile/osfile_async_worker.js, 0x10de53800)
├────4.37 MB (02.11%) -- storage
│    ├──2.48 MB (01.20%) ++ prefix-set
│    └──1.89 MB (00.91%) ++ sqlite
├────2.39 MB (01.16%) -- atom-tables
│    ├──2.33 MB (01.13%) ── main
│    └──0.06 MB (00.03%) ── static
└────2.31 MB (01.12%) ++ images

There's no trace of twitter.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@stevenwu Do you reproduce consistently by

  1. opening twitter.com
  2. closing twitter.com
  3. Measuring memory?

from ublock.

JBey4you avatar JBey4you commented on June 21, 2024

@Betsy25 : https://googledrive.com/host/0Bx8fnUCX4W2ISjlGTC1HOE0zNFE/uBlock.xpi

from ublock.

Betsy25 avatar Betsy25 commented on June 21, 2024

I get a message "The add-on could not be downloaded because of a connection failure on github.com" when trying to download it 😒
EDIT : Saving to disk and File/Open file... seems to works.
Thanks a lot !

from ublock.

stevenwu avatar stevenwu commented on June 21, 2024

@gorhill It doesn't happen with all sites, but it happens on twitter. With only uBlock enabled, I visit twitter and close the tab.

│   ├──21.49 MB (10.75%) -- top(none)/detached
│   │  ├──20.37 MB (10.19%) -- window(https://twitter.com/)
│   │  │  ├──12.83 MB (06.42%) -- js-compartment(https://twitter.com/)
│   │  │  │  ├──11.73 MB (05.87%) -- classes
│   │  │  │  │  ├───6.00 MB (03.00%) -- class(Object)
│   │  │  │  │  │   ├──3.27 MB (01.64%) -- objects
│   │  │  │  │  │   │  ├──2.39 MB (01.19%) ── gc-heap
│   │  │  │  │  │   │  └──0.88 MB (00.44%) ++ malloc-heap
│   │  │  │  │  │   └──2.72 MB (01.36%) ++ shapes
│   │  │  │  │  ├───2.81 MB (01.41%) -- class(Function)
│   │  │  │  │  │   ├──2.11 MB (01.06%) ++ objects
│   │  │  │  │  │   └──0.70 MB (00.35%) ++ shapes
│   │  │  │  │  ├───2.10 MB (01.05%) -- class(Array)
│   │  │  │  │  │   ├──2.09 MB (01.05%) ++ objects
│   │  │  │  │  │   └──0.01 MB (00.00%) ++ shapes
│   │  │  │  │  └───0.82 MB (00.41%) ++ (5 tiny)
│   │  │  │  └───1.10 MB (00.55%) ++ (4 tiny)
│   │  │  ├───4.28 MB (02.14%) ── style-sheets
│   │  │  ├───3.20 MB (01.60%) ++ dom
│   │  │  └───0.05 MB (00.03%) ── property-tables
│   │  └───1.12 MB (00.56%) ++ window([system])

After 'Minimize memory usage',

│   ├──20.27 MB (10.69%) -- top(none)/ghost/window(https://twitter.com/)
│   │  ├──12.74 MB (06.72%) -- js-compartment(https://twitter.com/)
│   │  │  ├──11.73 MB (06.18%) -- classes
│   │  │  │  ├───5.99 MB (03.16%) -- class(Object)
│   │  │  │  │   ├──3.27 MB (01.72%) -- objects
│   │  │  │  │   │  ├──2.38 MB (01.26%) ── gc-heap
│   │  │  │  │   │  └──0.88 MB (00.47%) ++ malloc-heap
│   │  │  │  │   └──2.72 MB (01.44%) ++ shapes
│   │  │  │  ├───2.81 MB (01.48%) -- class(Function)
│   │  │  │  │   ├──2.11 MB (01.11%) ++ objects
│   │  │  │  │   └──0.70 MB (00.37%) ++ shapes
│   │  │  │  ├───2.10 MB (01.11%) -- class(Array)
│   │  │  │  │   ├──2.09 MB (01.10%) ++ objects
│   │  │  │  │   └──0.01 MB (00.00%) ++ shapes
│   │  │  │  └───0.82 MB (00.43%) ++ (5 tiny)
│   │  │  └───1.01 MB (00.53%) ++ (4 tiny)
│   │  ├───4.28 MB (02.26%) ── style-sheets
│   │  ├───3.20 MB (01.69%) -- dom
│   │  │   ├──1.95 MB (01.03%) ── element-nodes
│   │  │   └──1.25 MB (00.66%) ++ (5 tiny)
│   │  └───0.05 MB (00.03%) ── property-tables

Restart browser with only ABP on, visit twitter

─22.28 MB (08.28%) -- top(none)/detached
│   │  ├──20.32 MB (07.55%) -- window(https://twitter.com/)
│   │  │  ├──13.29 MB (04.94%) -- js-compartment(https://twitter.com/)
│   │  │  │  ├──11.88 MB (04.42%) -- classes
│   │  │  │  │  ├───6.11 MB (02.27%) -- class(Object)
│   │  │  │  │  │   ├──3.31 MB (01.23%) ++ objects
│   │  │  │  │  │   └──2.79 MB (01.04%) ++ shapes
│   │  │  │  │  ├───2.97 MB (01.10%) ++ (7 tiny)
│   │  │  │  │  └───2.80 MB (01.04%) ++ class(Function)
│   │  │  │  └───1.41 MB (00.52%) ++ (4 tiny)
│   │  │  ├───4.28 MB (01.59%) ── style-sheets
│   │  │  ├───2.70 MB (01.01%) ++ dom
│   │  │  └───0.05 MB (00.02%) ── property-tables
│   │  └───1.96 MB (00.73%) ++ (2 tiny)

Minimize memory usage.

211.17 MB (100.0%) -- explicit
├───71.31 MB (33.77%) -- js-non-window
│   ├──47.81 MB (22.64%) -- zones
│   │  ├──40.66 MB (19.25%) -- zone(0x10038e800)
│   │  │  ├──24.15 MB (11.44%) ++ (213 tiny)
│   │  │  ├──10.39 MB (04.92%) ── unused-gc-things
│   │  │  └───6.12 MB (02.90%) -- strings
│   │  │      ├──6.07 MB (02.88%) -- string(<non-notable strings>)
│   │  │      │  ├──4.69 MB (02.22%) -- gc-heap
│   │  │      │  │  ├──4.55 MB (02.16%) ── two-byte
│   │  │      │  │  └──0.13 MB (00.06%) ── latin1
│   │  │      │  └──1.39 MB (00.66%) ++ malloc-heap
│   │  │      └──0.05 MB (00.02%) ++ (3 tiny)
│   │  ├───6.87 MB (03.25%) -- zone(0x100389000)
│   │  │   ├──6.54 MB (03.10%) -- strings/string(<non-notable strings>)
│   │  │   │  ├──4.21 MB (01.99%) -- gc-heap
│   │  │   │  │  ├──4.21 MB (01.99%) ── latin1
│   │  │   │  │  └──0.00 MB (00.00%) ── two-byte
│   │  │   │  └──2.33 MB (01.10%) -- malloc-heap
│   │  │   │     ├──2.33 MB (01.10%) ── latin1
│   │  │   │     └──0.00 MB (00.00%) ── two-byte
│   │  │   └──0.33 MB (00.16%) ++ (5 tiny)
│   │  └───0.29 MB (00.14%) ++ zone(0x10038c800)
│   ├──21.03 MB (09.96%) -- runtime
│   │  ├──10.95 MB (05.19%) -- gc
│   │  │  ├───6.00 MB (02.84%) ── nursery-committed
│   │  │  ├───4.48 MB (02.12%) ── nursery-huge-slots
│   │  │  └───0.47 MB (00.22%) ++ (2 tiny)
│   │  ├───4.75 MB (02.25%) ── script-data
│   │  ├───4.10 MB (01.94%) ── atoms-table
│   │  └───1.23 MB (00.58%) ++ (10 tiny)
│   └───2.47 MB (01.17%) ++ gc-heap
├───34.55 MB (16.36%) ── heap-unclassified
├───34.08 MB (16.14%) -- window-objects
│   ├──23.02 MB (10.90%) -- top(about:memory, id=24)
│   │  ├──22.54 MB (10.67%) -- active/window(about:memory)
│   │  │  ├──20.87 MB (09.88%) -- dom
│   │  │  │  ├──20.40 MB (09.66%) ── orphan-nodes
│   │  │  │  └───0.47 MB (00.22%) ++ (5 tiny)
│   │  │  └───1.67 MB (00.79%) ++ (4 tiny)
│   │  └───0.47 MB (00.22%) ++ js-zone(0x1294ba800)
│   ├───6.69 MB (03.17%) -- top(chrome://browser/content/browser.xul, id=3)
│   │   ├──5.86 MB (02.77%) -- active
│   │   │  ├──5.69 MB (02.70%) -- window(chrome://browser/content/browser.xul)
│   │   │  │  ├──3.36 MB (01.59%) ++ (4 tiny)
│   │   │  │  └──2.33 MB (01.11%) ++ js-compartment([System Principal], about:blank)
│   │   │  └──0.16 MB (00.08%) ++ window(about:blank)
│   │   └──0.84 MB (00.40%) ++ js-zone(0x10e4a1800)
│   ├───2.85 MB (01.35%) -- top(chrome://browser/content/hiddenWindow.xul, id=1)
│   │   ├──2.53 MB (01.20%) ++ active
│   │   └──0.32 MB (00.15%) ++ js-zone(0x10cc0f000)
│   └───1.52 MB (00.72%) ++ (3 tiny)
├───29.72 MB (14.07%) -- add-ons/{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0x10038e800)/compartment([System Principal], jar:file:///Users/steve/Library/Application%20Support/Firefox/Profiles/wsfak2c9.default-1414472644129/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js (from: resource://gre/modules/addons/XPIProvider.jsm:4176))
│   ├──29.49 MB (13.97%) -- classes
│   │  ├──20.44 MB (09.68%) -- class(Object)
│   │  │  ├──10.90 MB (05.16%) -- objects
│   │  │  │  ├───6.03 MB (02.86%) -- malloc-heap
│   │  │  │  │   ├──6.03 MB (02.86%) ── slots
│   │  │  │  │   └──0.00 MB (00.00%) ── elements/non-asm.js
│   │  │  │  └───4.87 MB (02.31%) ── gc-heap
│   │  │  └───9.53 MB (04.51%) -- shapes
│   │  │      ├──6.91 MB (03.27%) -- gc-heap
│   │  │      │  ├──6.85 MB (03.24%) ── dict
│   │  │      │  └──0.06 MB (00.03%) ++ (2 tiny)
│   │  │      └──2.62 MB (01.24%) -- malloc-heap
│   │  │         ├──2.60 MB (01.23%) ── dict-tables
│   │  │         └──0.02 MB (00.01%) ++ (2 tiny)
│   │  ├───8.74 MB (04.14%) -- class(Array)
│   │  │   ├──8.74 MB (04.14%) -- objects
│   │  │   │  ├──7.59 MB (03.60%) ── gc-heap
│   │  │   │  └──1.15 MB (00.54%) ++ malloc-heap
│   │  │   └──0.00 MB (00.00%) ++ shapes
│   │  └───0.31 MB (00.15%) ++ (4 tiny)
│   └───0.23 MB (00.11%) ++ (5 tiny)
├───20.99 MB (09.94%) -- heap-overhead
│   ├──15.88 MB (07.52%) ── bin-unused
│   ├───2.78 MB (01.32%) ── page-cache
│   ├───2.32 MB (01.10%) ── bookkeeping
│   └───0.00 MB (00.00%) ── waste
├────6.80 MB (03.22%) ++ (17 tiny)
├────4.31 MB (02.04%) -- workers/workers(chrome)
│    ├──2.34 MB (01.11%) ++ worker(resource://gre/modules/osfile/osfile_async_worker.js, 0x10e63a800)
│    └──1.96 MB (00.93%) ++ worker(resource:///modules/sessionstore/SessionWorker.js, 0x11d92dc00)
├────4.16 MB (01.97%) -- storage
│    ├──2.27 MB (01.08%) ++ prefix-set
│    └──1.88 MB (00.89%) ++ sqlite
├────2.82 MB (01.34%) -- images
│    ├──2.49 MB (01.18%) ++ chrome
│    └──0.33 MB (00.16%) ++ content
└────2.43 MB (01.15%) -- atom-tables
     ├──2.37 MB (01.12%) ── main
     └──0.06 MB (00.03%) ── static

from ublock.

stevenwu avatar stevenwu commented on June 21, 2024

Here's how 'Explicit Allocations' change after each run with one 'Minimize memory usage',

174 MB -> 144 MB  no addons
219 MB -> 204 MB  ABP
202 MB -> 199 MB  uBlock

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@stevenwu Ok I get your first step, i.e. the detached twitter window, but not the second step, i.e. when I minimize, there is no ghost windows left behind, no matter how often I try.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

I'm with Firefox 34.0, while you say you are 34.0.5, who knows if this could be the reason.

Regarding the "Explicit allocations" your report, I roughly get the same values as yours for uBlock and no addons. However for ABP I get 245 MB. But I have all the default filter lists of uBlock see notes selected in ABP (acceptable ads disabled). Is this your case as well?

@fhoshino above also reported ghost windows, while said to be with Windows, but also using FF 34.0.5.

from ublock.

stevenwu avatar stevenwu commented on June 21, 2024

For ABP, I had easylist without element hiding helpers. With easylist, I get 246 MB. Drops to 221 MB after minimizing memory.

from ublock.

harshanvn avatar harshanvn commented on June 21, 2024

Am able to reproduce the ghost window/s with uBlock only on v34. No specific steps to follow, after using some time, i get (some times and some times not) ghost windows (after CC,GC, min).
System: Win 7 32 bit (office machine, so anonymized the report)

Attached memory report, which can be viewed thru firefox
https://docs.google.com/file/d/0BzwS1XH8I9buV2JqU2V0RlUwY3M/

from ublock.

gorhill avatar gorhill commented on June 21, 2024

Thanks @harshanvn. I suspect this could be related to the mutation observer in the content script. Last time I checked, ABP did not have a mutation observer. Under observer-service, I see two dead weak references. This matches the count of two ghosts windows. Maybe adding an explicit observer.disconnect() when a web page unloads is something to try. With Chromium, I expect everything is cleaned-up when a page goes away, but maybe that is different with Firefox. Even better, having cleanup code to remove all hooks for when a page shut down looks like a good ideas anyways.

from ublock.

harshanvn avatar harshanvn commented on June 21, 2024

Ok, Good, to have the issue identified.

from ublock.

gorhill avatar gorhill commented on June 21, 2024

Ok, Good, to have the issue identified

No way, I said "I suspect this could". In developer speak, this means "need to investigate further", and it could easily lead nowhere.

from ublock.

fhoshino avatar fhoshino commented on June 21, 2024

Though it might be I have started the mem usage bug report, but should we create a new ticket rather than continuing on this thread?

from ublock.

gorhill avatar gorhill commented on June 21, 2024

@fhoshino Actually my thought this morning is we should refrain from reporting problems, as per "Issues should be filed once @Deathamns decides it's ready for this". Myself I should have refrained from posting benchmarks in the thread itself (got carried away as it worked better than I expected -- on my side at least), it has become too noisy at this point.

from ublock.

harshanvn avatar harshanvn commented on June 21, 2024

Sure gorhill. I understand. :)

from ublock.

yoasif avatar yoasif commented on June 21, 2024

I'm curious about one thing though. There is a constant crash in e10s enabled Nightly.
After the extension is installed, restart the browser and all tabs will crash because of the extension. However, if I disable the extension, and enable it (via the Add-ons Manger, without restarting the browser), then It will work normally. Can someone confirm this?

@Deathamns I can confirm this on the latest nightlies on my x64 Linux machine.

I have taken to disabling the plugin before shutting down (or restarting to update to the latest nightly), then re-enabling after the browser is restarted. It works fine after that.

from ublock.

hollingsworthd avatar hollingsworthd commented on June 21, 2024

I suspect this could be related to the mutation observer in the content script.

@gorhill Assuming your hunch is correct (which I have not tested on FFv34), unregistering would be fine, but also you might specify ownsWeak=true (the last param of the addObserver method) --

https://github.com/Deathamns/uBlock/blob/ports/xpi/platform/firefox/frameModule.js
line 162: Services.obs.addObserver(this, 'document-element-inserted', false);

(Would need to add QueryInterface for Ci.nsISupportsWeakReference)
https://github.com/Deathamns/uBlock/blob/ports/xpi/platform/firefox/vapi-background.js
line 1034: Services.obs.addObserver(httpObserver, 'http-on-opening-request', false);
line 1035: // Services.obs.addObserver(httpObserver, 'http-on-modify-request', false);
line 1036: Services.obs.addObserver(httpObserver, 'http-on-examine-response', false);

Reference:
https://developer.mozilla.org/en-US/docs/Extensions/Common_causes_of_memory_leaks_in_extensions

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

@yoasif OK, I see you did your part too. Hopefully someone will notice it.

@hollingsworthd Using weak references probably won't hurt, but I guess the problem is with the way I use sandboxes, and share extension APIs with them... I'll revisit that part.

from ublock.

fhoshino avatar fhoshino commented on June 21, 2024

@Deathamns I tried the latest build but still getting the ghost windows problem.

from ublock.

Deathamns avatar Deathamns commented on June 21, 2024

@fhoshino Nobody said that there was a change about that.

from ublock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.