[FIXED] Stall/high cpu usage with youtube, high tab count, firefox

Ask for help about NoScript, no registration needed to post
Guest

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by Guest »

Nope. Behavior is unchanged with 40rc2.
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by Giorgio Maone »

Have you got an idea of the discarded/live ratio of those tabs?
Does the problem happen right away after session restore (when most tabs should be discarded), or there's a minimum of live tabs to trigger it?
Asking because I wrote a script opening 1600 tabs over 2 windows rotating across 4 urls, but I could only open them discarded because otherwise the simultaneous load attempt take the system to its knees.
Also having a sample of the URLs opened in those tabs would be useful.
The best scenario would be having a snapshot of your browser profile, but that's probably too much to ask.
Anyway, a Firefox 79 clean profile with 1600 mostly discarded open tabs on Firefox 79 with NoScript 11.0.40rc2 is having no problem whatsoever with Youtube here.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
Guest

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by Guest »

I don't have a precise measure of the ratio but it is high (or low if we're talking live:discarded). This behavior is present *immediately* after restart. I just did a test. First, I waited several minutes for the firefox processes to go mostly quiet: memory growth slowed/stopped, all 'dancing ball' tab animations finished. It's clearly bringing live some tabs but I don't know how many. I then create one new tab and visit youtube.com and the problem immediately presents and it takes a minute or more for the youtube tab to fully display. Meanwhile, UI and other elements are very slow to respond.

While in this phase, I noticed another behavior. In Task Manager, I'd watch memory and cpu usage which mostly was as previously described. For 15-20 seconds, memory would grow about 3-4GB in a fairly straight ramp. Plenty of churn while holding to a mostly steady workingset. Then it would switch to a shrinking mode during which one thread of one core would run at 90% while memory usage would shrink over 1-5 minutes. Once that phase ended, the new tab was usable. Smells like a broken GC.

Willing to do tests/logging but not able to allow more personal information to escape, sorry.

One more piece of information: AVG is present on this system. Since AVs have their damned sorry fingers so deep in the OS I thought I'd mention. Turned it off and retested. No behavior change.
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
M-R

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by M-R »

I can confirm the same behaviour.

Seeing that I had this problem for months and it's getting worse, and the latest poster had it only for a few weeks, maybe it could be useful to know what he did just before it started, I don't know (I don't remember what I did before I noticed it, I don't watch yt daily and I didn't notice probably the problem early enough, and right at the beginning I thought that it was because I had too many open tabs. It thing I remember it being not so noticeable, but maybe I am simply misremembering)

Among the things I tried, after removing and installing again NoScript, was to delete the cache of Firefox and other things, after that if I did click on the down arrow at the far right of the tabs line, and looked at the list of tabs, everyone had lost the icon, and Firefox occupied less memory. But I still had the problem with you tube video (an enbedded yt video in a page is enough to block my PC for minutes!

Opening the tabs without icons makes Firefox "reload again" that tab, I presume, and if I do that for too many tabs Firefox begin to take a lot of memory and gets slower, ma that is I think a separate issue, I don't notice changes in the behaviour of FF when I go on pages with yt videos, if I do it when I have just started FF or later.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
John X

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by John X »

Reading the last two postings, I got a strong feeling of déjà vu.
What you're experiencing has a very similar feel to what was happening
to me 18 months ago, eventually forcing me to move from Windows 7 to
Windows 10.

It took me months, but I finally figured out what was going on. I
recently posted an article about it, and some related subjects.

** 17-Aug-20 World View -- Microsoft's monopolistic practices leave Windows 10 vulnerable to massive hacking attack
In mid-January 2019, on a Tuesday afternoon, all of a sudden my Windows 7 computer started getting incredibly slow. Firefox was brought to its knees, and Chrome was working intermittently.

I spent many days trying to figure out which process was causing the problem, and then I realized that it was far more sinister: Whenever I started using Firefox, or a Youtube video on Chrome, or Windows Media Player, or any of several other programs, then the problem would occur. What would happen is that that particular program would only use 15-20% of the cpu, but Windows would magically jack up the CPU usage of other normally innocuous processes.

So for example, when the system was mostly idling, process explorer might show the top cpu users as omnipage 1.3%, firefox 0.9%, sidebar 0.9%, emacs 0.1%, acro rd32 0.3%, and so forth, totalling around 10%.

But when I started up a youtube video on chrome, that process would use 23% of the cpu, which wouldn't be a problem. But all of those numbers in the last paragraph were now jacked up to 13.1%, 8.4%, 5.6%, and so forth, totaling 100%, bringing the system to its knees.

In other words, starting up something on Chrome or Media Player or any of numerous other programs would affect every other process on the system. For example, I open Media Player, and suddenly Emacs would go from using 0.1% of the cpu to 13.1% of the cpu, which makes no sense at all.

So I started searching the internet, and I found that it's happening to other people. Apparently it was triggered by a particular windows update. Being a paranoid individual, I took note of the fact that this problem started occurring the same week that Microsoft reminded everyone that Windows 7 support would expire in a year, [...]

I'm one of the few users who could figure out what was going on, since I spent many years of my career developing operating systems. I developed three embedded operating systems, and two mainframe operating systems, so I'm very capable of diagnosing these situations.

So after a great deal of analysis, I knew that the only way this problem could be occurring would be is if someone (Microsoft) changed the operating system in a certain way. There's a process queue in the core of any timesharing operating system, and there's a core o/s function that takes the top process off the queue and gives it a time slice -- let's it execute for a few milliseconds. When the time slice expires, then that process goes on the bottom of the process queue, and the new top of queue is allowed to run for a time slice. That's how the operating system makes it appear that multiple programs are all running simultaneously when, in fact, they are running in turn, a few milliseconds at a time.

So the problem I was having could happen only one way: Microsoft had modified the operating system on my computer to add several milliseconds of time in a do-nothing loop to each time slice for each process. This might have been simply a bug, and that's why I was hoping that it would be corrected in the next Windows update. But it wasn't corrected in the next update or the one after.
I'm not saying that your problem is the same, but it sure has the same
feel.
Last edited by barbaz on Mon Aug 24, 2020 8:26 pm, edited 1 time in total.
Reason: Replace blog link with relevant quote
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
Guest

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by Guest »

Thanks for the input but that doesn't quite line up with current events. No other process is affected by this. There's plenty of idle time with several unused processor threads and Chrome continues to function as it usually does and can play the very Youtube video that is strangling FF. I believe we also have a Win10 report in here.

One additional piece of information and it's entirely anecdotal: I have no data to back it up. But @M-R mentions the problem is getting worse and that's my impression as well. And it does so without upgrades to OS, FF, or NoScript. This makes absolutely no sense at all and I have no data so I have avoided mentioning it. But perhaps this is an important observation. Consider or discount as appropriate...
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
M-R

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by M-R »

Guest wrote: Mon Aug 24, 2020 9:56 pm Thanks for the input but that doesn't quite line up with current events. No other process is affected by this. There's plenty of idle time with several unused processor threads and Chrome continues to function as it usually does and can play the very Youtube video that is strangling FF. I believe we also have a Win10 report in here.
And I am using Linux Mint 19.3.

I too don't see the widespread spike John X reported, The only programs affected seems to be Firefox (and Noscript, that is the only add-on I currently use apart from the standard one like languages and Shockwave Flash and OpenH64, the only one I installed from my last update).

The same movie clip that bring my firefox to its knees, run without any problem if I download it and play it with Celluloid, or Media Player. And even when Firefox hangs, I can usually use the other programs running, for example reading a pdf during the wait for FF to return usable (the exception is what FF take up so much memory to use 100% of the system memory - as for example a couple oh hours ago when I naively opened a webpage without realizing that there was a yt video embedded in the bottom, and right from the first second, without even having finished to download the page, the main thread of Firefox jumped from 1GB to 5GB and the Webestension thread jumped from 100mb to 3 GB. the System jumped in a few seconds from 60% occupied memory to 100% and everything froze.

When this happen, I usually wait a little (or more than a little, if I have something important that I don't want to lose in a reset). This time I waited an hour, and two tabs in two windows crashed restoring a little memory to my system, enough to make it run again. Every time this happen, NoScript goes into a un-declared "every script can run, non matter what I say" mode. I noticed it a while ago when I started noticing that every page after something like this happened started to have a lot of ads and pop-ups, checking noscript the little windows only shows the little ghost, but the add-on page gives noscript as running. Well, to get noscript back, I have to close it clicking on the blue dot oin the "extensions" page, and then clik on it again to start it again, THEN I have to reload every tab that was displayed in a open windows.

That is what happen when I am lucky and I don't lose what I was working on. If I am not lucky and no tabs crashes restoring a little memory, after 2-3 hours I give up and go raising little elephants in a boring way (I had to learn that to avoid using the hardware reset button as I did at the beginning of this problem)

I don't know what to do, it's getting worse and worse, I have used NoScript for years and I really fell naked to browse the garbage-ridden web of today without it, so I am trying to resist until a solution will be found, but I can't continue having these freeze every time I open a page with an embedded yt video...
One additional piece of information and it's entirely anecdotal: I have no data to back it up. But @M-R mentions the problem is getting worse and that's my impression as well. And it does so without upgrades to OS, FF, or NoScript. This makes absolutely no sense at all and I have no data so I have avoided mentioning it. But perhaps this is an important observation. Consider or discount as appropriate...
i upgraded a lot of things. As I said, I am hoping that an upgrade would fix it, so I am keeping currect with the latest (stable) version of everything, I am currently on Noscript 11.0.40 (from a few hours ago), I was on 11.0.39 even before it was announced on the site (I click "check for updates" on noscript every day, even if I know it will be updated eventually even if I don't do that). So I don't know if it getting worse because of something in my system, or because of something in NoScript...
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
Guest

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by Guest »

Today I made a discovery.

After rebooting the PC and starting Firefox, I had to watch a video on YouTube. Without thinking much about it I opened a private window, just to see if it changed anything... ad it did. No problem at all. A new private window, with a single tab, where I wasn't logged on you tube with my account, and I could watch the 10' video without any hassle and any freeze.

I didn't know if the problem was solved by the latest noscript update, or by using a private window, or by the fact that I was a using a window with a single tab, so i tried watching the SAME video in one of the others not-private opened windows, one with more than 1000 open tabs. And Firefox froze, as usual. I tried to follow what happened. Before, I had the main thread at around 1,3 GB of memory used, and Webextension at less than 200 mb. Then, both started to spike up (I think that the main thread was the first, but they did it so quickly that I am not sure), until the main thread was at 4 GB and webextension at 2 GB, both with cpu use at more than 100% (I have a quad core cpu and the system monitor is set up to show every cpu use from 0 to 100%, so these two threads were keeping two core fully used and more)

Then, the main thread began to drop down, returning to around 1,5 GB (and cpu use under 50%), but webextensions went up to 3 GB and its cpu use at 120%. Then, the main thread started to go up again and webextension went down... every time there was an inversions (the one that went up start to goes down and the one that went down start to goes up) there is a noticeable drop in the total memory used, that then start to goes up again, but not to the highest point it reached before, it goes up, up, up, and then another drop, another inversion (the one that was going down start to go up, etc.), and total memory use goes up again, until little by little there waves are smaller and smaller (but Firefox is still frozen), until... webextension suddenly drop down, from 2GB to almost zero, it doesn't go up again, and Firefox is unfrozen.

Then, I did another experiment: new window, a single tab, but NOT a private one. Trying to watch the same video in the same page. Firefox still froze.

So, I tried another experiment: I logged out from youtube in the latest single tab windows. Doing that make fifefox load the page again... and Firefox froze, again. In the same way. I tried to watch the same you tube video in that not-private window, and again, firefox froze.

I tried to open a new tab in that window after a couple of minutes, and it opened, so it seems that not everything was frozen at that point (it was still impossible to watch the video, though, I had to wait more for that. Clicking to video does start the "rotating circle of waiting" on the clip but nothing started until 10 minutes later, when Firefox fully unfroze. In the meantime, the total memory used went even more up than before, it reached 190% cpu use and 3,5 GB for Wextensions and 5 GB for main thread)

I had opened the tab to make another experiment: closing the you-tube window and see if Firefox would froze, even if the other tab was totally empty. It didn't froze.

For last, another experiment: I opened another incognito mode windows, to see if after all that it still worked without freezing. It did. No freezing at al, no spike in memory used, I could watch the video after a couple of seconds

So, it seems that "incognito mode" solves the problem. Being logged on you tube or having a lot of tabs in the window or only one doesn't seem to make any difference (but keep in mind that I still had more than 10.000 open tabs in other windows, maybe that counts).

I send you my NoScript Options>Export file a few days ago, did you receive it?
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by Giorgio Maone »

Guest wrote: Wed Aug 26, 2020 6:52 pm So, it seems that "incognito mode" solves the problem. Being logged on you tube or having a lot of tabs in the window or only one doesn't seem to make any difference (but keep in mind that I still had more than 10.000 open tabs in other windows, maybe that counts).
That's really interesting, thank you for sharing.
Guest wrote: Wed Aug 26, 2020 6:52 pm I send you my NoScript Options>Export file a few days ago, did you receive it?
If you're the one who previously posted as "M-R", then yes, thank you.

Since you're experimenting a lot, may I ask you to check whether the problem goes away if you disable the XSS filter from the Advanced options tab?
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
M-R

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by M-R »

Yes, I asm M-R, I forgot to put the username in the last post, sorry.
Giorgio Maone wrote: Wed Aug 26, 2020 7:22 pm
Guest wrote: Wed Aug 26, 2020 6:52 pm So, it seems that "incognito mode" solves the problem. Being logged on you tube or having a lot of tabs in the window or only one doesn't seem to make any difference (but keep in mind that I still had more than 10.000 open tabs in other windows, maybe that counts).
That's really interesting, thank you for sharing.
Guest wrote: Wed Aug 26, 2020 6:52 pm I send you my NoScript Options>Export file a few days ago, did you receive it?
If you're the one who previously posted as "M-R", then yes, thank you.

Since you're experimenting a lot, may I ask you to check whether the problem goes away if you disable the XSS filter from the Advanced options tab?
I clicked on "options", then in the "advanced" tab, the only checked option was "sanitize cross-site suspicious request", so I de-selected that (I did not clear the xss choices), then I opened a new tab in the "more than 1000s tabs" not-private window I used before and tried to watch the same you tube video. Firefox froze as before. I even had the impression that it was WORSE than before, more memory used (Main thread went up to 5,5 GB) and for a longer time, but I am not sure, maybe I was simply more impatient or maybe it gets worse each time until I reboot, I don't know.

After a while, tired of waiting, I clicked to close the tab. The tab close only after almost a minute, but it changed nothing, even with that tab with the video closed, Firefox was still frozen for at least other 5 minutes, no difference at all if the tabs gets closed.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
M-R

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by M-R »

Reading again the initial post of the thread, I think there is a difference in my firefox behaviour: the only affected threads are the Main Thread and the Webextension thread, the other firefox threads stays under the 400-500 mb each and cpu use almost at zero.

(this is probably because I rebooted firefox a few hours ago, in time the other threads usually gets bigger and bigger, but the causes of that is probably unrelated with this problem)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
Guest

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by Guest »

It should be the same. Processes own memory, threads own an execution unit (hyperthread, core, etc.). Two threads in each of two FF processes become active (but not 100% saturating - each thread is about 50% of capacity for a total of 1 fully busy core in i7 terminology). The remaining 11 FF processes (in my case) are mostly idle.
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
M-R

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by M-R »

Probably I didn't use the correct terminology, I used "thread" because the "thing" called "main thread" in the Linux Mint System Monitor is the one that goes to more than 5 GB, but that and the "webextensions" thing are listed under "Process Name".
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
M-R

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by M-R »

I did open the same yt pare as before, to give more informations to Giorgio with screen captures of the system monitors, but this time the behaviour was different. There were no "inversions", the Main Thread never dropped, but it continued to go higher and higher, reaching over 7 GB after seven minutes. Webextension was the only one to drop 2-3 times to almost zero, but then quickly rose again. And the total memory used increased with each "wave" instead of decreasing like before, reaching after 7,5 minutes almost a total of 9-10 GB, then webextension dropped one last time and main thread went down quickly too.

I will send the screenshots to Giorgio after posting this
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
M-R

Re: Stall/high cpu usage with youtube, high tab count, win7 firefox

Post by M-R »

The behaviour of this problem is more and more strange... I said in the last post that I opened a yt page to make some screenshot, right? Well, i forgot to close it again.

A few minutes ago, after almost two hours, I realized that I had forgotten to close it. So I did, sure that it would not cause any problem: as i posted today, I had closed a yt page in a previous experiment, and it didn't cause any freezing, right?

Well, this time closing the page did froze my Firefox, for 3-4 minutes, with the memory used jumping 4-5 GB higher (it's less than what happened when I opened the page, opening it caused a 7-8 minutes freeze with the total memory much higher, but still an hassle). I am sure that the tab next to it had no yt video and in any case it was already in memory having read it a few hours before.

So... why sometimes closing a yt page don't cause any hassle, and other times it freeze Firefox? I have really no idea, I am beginning to think that my PC is haunted by the spectre of an old You Tube coder that can't stand these pages...
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
Post Reply