Page 4 of 5

Re: browser constantly hangs for brief moments

Posted: 2021-04-07, 18:24
by [PCMartin]
vannilla wrote:
2021-04-06, 22:01
[T]his issue actually happens in other browsers too, but those browsers hide the fact using smokes and mirrors. * * * Set the cache to the default value: you are actually losing performance regardless of the sites you visit. Use eMatrix or whatever if you want to keep it clean periodically.
If by smoke and mirrors you mean multiple processes that, in the aggregate, thrash the CPU, I noticed something like that yesterday in Brave. I was watching a live YouTube stream (with that ADHD chat feed on the right ;) ), and Brave's processes (two of them accounting for the lion's share) were consistently using over 50% of my CPU cycles. I'm almost certain I never got close to that in Pale Moon's single process.

I haven't yet tried to check Brave's CPU usage when I'm composing in Gmail, but in Pale Moon I surmised that Gmail's constant "cloud updating" of new input was involved in my Gmail-related hangs. Maybe composition, or some aspect of it, gets split off to a separate process in multi-process browsers.

SIDEBAR: I'm a non-coder, but I have to wonder how long Pale Moon can last as a single-process browser if an increasing number of sites are coded for multi-process with no (or grossly inadequate) fallback provisions for single-process. I imagine that that's the kind of thing that has to be handled on the site coders' end. (Again, though, maybe flushing "zombie blobs" once the tab that loaded them has been closed or unloaded is something that could be done on the browser side, at least for the major offenders.) I'm guessing that a lot of websites are now designed exclusively for Google Chrome and that even Safari and Firefox users are lucky if any special accommodations have been made for them. It's a potential antitrust issue, to my mind, but (sadly) one that is unlikely to gain any traction.

I vaguely recall that I set my cache to zero many months ago to test the possibility that something cache-related was contributing to my hangs. My laptop and Internet connection are relatively fast and I usually have plenty of free RAM, so I didn't really notice a performance hit (except maybe when I reloaded tabs that had been automatically unloaded by Lull The Tabs). I kind of forgot about it and left the cache at zero. I just now reset it to the default automatic cache management and will see how that goes. I expect unloaded tabs will reload a second or so more quickly.

My caveman conclusion is, "Gmail, YouTube, BAD! Hit with club, burn with fire!" ;)

I appreciate your followup!

Re: browser constantly hangs for brief moments

Posted: 2021-04-08, 00:25
by moonbat
[PCMartin] wrote:
2021-04-07, 18:24
I surmised that Gmail's constant "cloud updating" of new input was involved in my Gmail-related hangs
I stopped using Gmail's web interface entirely in favor of IMAP in Interlink because of the bloat. If you look at your adblocker logs while watching a long Youtube video, you'll see constant blocked tracking pings and attempts to download advertising segments from doubleclick.net. I suspect the former is on Gmail as well.

Re: browser constantly hangs for brief moments

Posted: 2021-04-08, 04:20
by Moonchild
[PCMartin] wrote:
2021-04-07, 18:24
I was watching a live YouTube stream (with that ADHD chat feed on the right ;) ), and Brave's processes (two of them accounting for the lion's share) were consistently using over 50% of my CPU cycles. I'm almost certain I never got close to that in Pale Moon's single process.
I can just say I told you so. viewtopic.php?f=4&t=17442

Re: browser constantly hangs for brief moments

Posted: 2021-04-08, 05:41
by [PCMartin]
moonbat wrote:
2021-04-08, 00:25
I stopped using Gmail's web interface entirely in favor of IMAP in Interlink because of the bloat.
I've been thinking about switching to an email client for a while now (and actually even switching to a different email provider). I've been procrastinating because I wanted to use the same client in Windows and Linux and the future looked cloudy in that regard for a couple of years. But I see that Interlink is available for both, and if it works okay, maybe I'll use that.
moonbat wrote:
2021-04-08, 00:25
If you look at your adblocker logs while watching a long Youtube video, you'll see constant blocked tracking pings and attempts to download advertising segments from doubleclick.net. I suspect the former is on Gmail as well.
I really should have checked while I was still loading Gmail and YouTube in Pale Moon. I was (am) running eMatrix in Pale Moon with the obvious ad and tracking domains blacklisted across the board, but I suppose Alphabet/Google makes the requests from domains that must be whitelisted for the site to work. (Reminder: I'm not a coder.)

A YouTube livestream once again thrashed the hell out of my CPU in Brave today (even worse than yesterday), but at least pre-recorded YouTube videos seem to be reasonably well behaved. I suppose I could check uBlock Origin's logs for Brave in an attempt to see whether tracking and ad-serving attempts are contributing to the issue. Brave has its own set of built-in ad and tracking protections, and those might queer the applicability of any conclusions to Pale Moon to at least some degree.

I guess I have to see how YouTube livestreams perform in Google Chrome (with uBlock Origin active, of course), at least for testing purposes. (Trust me, I want to use that personal-data-mining, tracking, and profiling engine as little as possible. Hypocritical, I know, given that I still use Gmail. My excuse is that I have been using Gmail since it launched and will have to get a pretty big number of correspondents to change their contact info for me, and update an awful lot of site registrations.)

Regardless, I stand my original caveman conclusions.

Re: browser constantly hangs for brief moments

Posted: 2021-04-08, 06:14
by [PCMartin]
Moonchild wrote:
2021-04-08, 04:20
I'm
I can just say I told you so. viewtopic.php?f=4&t=17442
As an ordinary, garden-variety, non-coder user, I'm going to have to take another run at that post tomorrow, when I'm feeling less long-COVID brain-fogged. In the meantime, I'm just pissed at Alphabet/Google for sabotaging my favorite browser.

Re: browser constantly hangs for brief moments

Posted: 2021-04-08, 16:47
by person45
Plume wrote:
2021-04-02, 20:56
As an experiment I started using a seperate browser to check my email on outlook.live and since then my experience using Pale Moon has been much smoother. If I don't visit outlook.live.com then then I don't get all the freezes,
Ok, I can confirm this, I think.

I was browsing with Pale Moon for a day or so without any problems.

After I visited https://outlook.live.com/mail/inbox for the first time during the browsing session and then my ISP email account, I started having the scroll lag.

Is it possible that Microsoft made code that works "optimally" only with their Edge browser?

Re: browser constantly hangs for brief moments

Posted: 2021-04-08, 16:58
by person45
Kris_88 wrote:
2021-04-05, 15:38
We can investigate this using the simpe gc/cc monitor.
Best post in this thread. Thank you, Kris.

Re: browser constantly hangs for brief moments

Posted: 2021-04-08, 21:00
by Moonchild
person45 wrote:
2021-04-08, 16:58
Kris_88 wrote:
2021-04-05, 15:38
We can investigate this using the simpe gc/cc monitor.
Best post in this thread. Thank you, Kris.
It's certainly interesting but monitoring total times the GC or CC is busy really isn't the end-all of it (nor does it help finding the cause of any pauses, at most just confirming they exist). What it can do is indicate whether page scripting is creating compartments that aren't being released, e.g. if the number goes up visiting a certain site and won't go back down.
GC for example has several modes it can operate in: full GC, incremental GC and generational GC. Full GC is what you will see the largest pauses with, but that doesn't tell you how "busy" the garbage collector actually is.

That being said I have looked at trying to deal with both ghost windows and making the CC more aggressive, but with little luck in tackling this particular issue that seems to be specifically problematic with these Google and Microsoft web applications and the way they are designed. Reverse-engineering their web scripting is quite impossible to find out where these leaks come from, but my guess is poor observer management in the scripts that might lock compartments as "busy". GC and CC can only do so much in how they trace whether objects and compartments are still considered "in use" or not, especially if web content creates chain dependencies (e.g. create an object with an observer that creates and observes another object, etc. -- an insidious type of recursion).

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 01:06
by [PCMartin]
Kris_88 wrote:
2021-04-06, 12:57
No matter how badly the site was made, all objects should be released when the tab is closed:
Regrettably, my level of technical knowledge is so low that this thread is the first time I've been exposed to the concepts of garbage collection and cycle collection. With that caveat in mind, it seems clear to me that objects spawned by Gmail and YouTube are not being released when their tabs are closed (in my Pale Moon configuration, at least). They seem to persist indefinitely, hogging RAM and causing hangs until the browser itself is closed.

Am I correct in interpreting that Alphabet/Google might not even have bothered to code a garbage/cycle-collection routine for Gmail and YouTube objects because it assumed that those sites would always be loaded in a multi-process browser in which killing the entire process would take care of the problem? Is there any way on the browser side, independently of how a site is coded, for a single-process browser to track which objects are spawned by a given tab and forcibly purge them when the tab is closed?

Again, my technical understanding is extremely limited, which is why I'm glad that Pale Moon has users like you with the chops to know what to look for, how to find it, and what conclusions to draw from the results. I've appreciated your contributions to this thread.

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 01:20
by Moonchild
[PCMartin] wrote:
2021-04-09, 01:06
Am I correct in interpreting that Alphabet/Google might not even have bothered to code a garbage/cycle-collection routine for Gmail and YouTube objects because it assumed that those sites would always be loaded in a multi-process browser in which killing the entire process would take care of the problem?
Kind of, but with the difference that garbage collection and cycle collection is the browser's task. What a website should do in their scripting is making sure they release resources so that the browser can discard them as-needed in either collection. The fact that these sites are apparently oblivious to their own really bad resource management is, however, the fact that they are normally targeting browsers that just throw out everything with the bath water by killing a content process, which naturally takes care of the problem any browser would otherwise have (including Chrome) with such a badly-scripted site.
[PCMartin] wrote:
2021-04-09, 01:06
Is there any way on the browser side, independently of how a site is coded, for a single-process browser to track which objects are spawned by a given tab and forcibly purge them when the tab is closed?
Of course there is but not a single browser manages its resources that way because it would result in totally abysmal performance and a lot of wasted resources on the computer running it on AND crippling network overhead. While it is technically possible to strictly separate all resources of tabs and make each tab have a completely isolated environment, it would not be practical; neither from a performance/resource management point of view, nor from a user experience point of view (certain things must be globally managed, like caching, cookies, history, etc., as well as scripting being able to "talk to" other frames/tabs/windows/documents through various APIs). Not to mention common style sheets and scripts.

I hope that clarifies at least somewhat. I know it gets rather thick.

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 01:22
by [PCMartin]
Moonchild wrote:
2021-04-08, 21:00
GC and CC can only do so much in how they trace whether objects and compartments are still considered "in use" or not, especially if web content creates chain dependencies (e.g. create an object with an observer that creates and observes another object, etc. -- an insidious type of recursion).
To the extent I understood it, I'm guessing this might answer the second question I posed in my previous comment … unfortunately … which brings me back to my caveman conclusion (Gmail, YouTube, BAD!). I appreciate your following this thread and the work you've put in to try to solve the problem, so thank you.

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 01:46
by person45
Moonchild wrote:
2021-04-08, 21:00

It's certainly interesting but monitoring total times the GC or CC is busy really isn't the end-all of it (nor does it help finding the cause of any pauses, at most just confirming they exist).
Wow, I'm a non-programmer, so I was happy just to see a tool that shows this errant behavior on a website.

I said this before. You're the mechanical engineer designing the next automobile when it should be the local mechanic who checks out the problems in my car.

You are on another level. Thank you for the hard work you put in.

Maybe as a feature request there can be a button that flushes 100% of the stored ram. It would save a few seconds compared to when restarting the browser. Or have an option in about:config that allows 3 tiers of culling: aggressive, moderate, or minimal.

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 03:30
by moonbat
person45 wrote:
2021-04-09, 01:46
Maybe as a feature request there can be a button that flushes 100% of the stored ram.
about:memory lets you force CC and GC cycles to free memory.

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 04:02
by [PCMartin]
Moonchild wrote:
2021-04-09, 01:20
What a website should do in their scripting is making sure they release resources so that the browser can discard them as-needed in either collection. * * * Of course there is [a way for browsers to track and purge objects spawned by a given tab] but not a single browser manages its resources that way because it would result in totally abysmal performance and a lot of wasted resources on the computer running it on AND crippling network overhead. * * * I know it gets rather thick.
Very nicely explained. And yes, it does [get thick]. Thanks again!

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 04:03
by badnick
So, maybe I didn't talk nonsense when I wrote here about GC viewtopic.php?f=70&t=26362&p=210503#p210503

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 07:52
by Moonchild
badnick wrote:
2021-04-09, 04:03
So, maybe I didn't talk nonsense when I wrote here about GC viewtopic.php?f=70&t=26362&p=210503#p210503
You were. Don't try to use my simplified general explanation to justify bad advice given.

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 15:26
by Vultural
person45 wrote:
2021-04-09, 01:46
... Maybe as a feature request there can be a button that flushes 100% of the stored ram.
Off-topic:
At the risk of sounding like a product endorsement ...
I have CleanMem installed. Small bar on the bottom of the desktop advises of memory usage.
Color goes from green - yellow - orange - red as memory is used.
A quick double click will release some. Seems to work, unless I visit some of the "problem" sites mentioned above.
I try to do gmail and outlook early.

Re: browser constantly hangs for brief moments

Posted: 2021-04-09, 16:54
by person45
moonbat wrote:
2021-04-09, 03:30
about:memory lets you force CC and GC cycles to free memory.
If I'm understanding correctly, the about:memory buttons will not be able to do their job because the Microsoft team neglected to assign the proper collection values.

There's no financial incentive for Microsoft to make efficent code for non-Edge browsers. They probably want to "convince" users to switch to Edge, and so this lag issue unintentionally popped up.

There's nothing wrong with Pale Moon's compatibility with live.com. The issue is on the server side.

If the problematic code cannot be isolated, then I was thinking about the "nuke" option. Is it possible to create a "smart nuke"? When Pale Moon detects bad behavior over 15 minutes or more, then a targeted approach over a section of ram could minimize the negative effects of "collateral damage".

Re: browser constantly hangs for brief moments

Posted: 2021-04-10, 08:08
by Kris_88
I can't confirm the problem with gmail.com.
Pale Moon 29.1.1 (64-bit), Windows 8.1.
Fresh profile, without add-ons and plugins, with Aeromoon 2.6.1 theme.

After closing the tab the values quickly return to normal after several bursts.
GC: 60/60 CC:8/8

Re: browser constantly hangs for brief moments

Posted: 2021-04-10, 20:13
by [PCMartin]
Kris_88 wrote:
2021-04-10, 08:08
I can't confirm the problem with gmail.com.
When I run Gmail, I keep its tab "permanently" pinned, and it's rare that I don't watch several YouTube newscasts in the course of a computer session, so in retrospect I didn't adequately test how problematic Gmail was on its own. At a minimum, though, hangs caused by accumulated YouTube garbage (whether the YouTube tabs had been closed or not) struck me as particularly severe when composing in Alphabet/Google sites, including Gmail specifically.

I will try running Gmail in Pale Moon once again while continuing to avoid YouTube and see what behavior I notice. If Gmail turns out to be Pale-Moon-friendly, or at least not too problematic, that will make my life a whole lot easier.

Over the course of the past six months to a year, I've noticed that hangs seem to fluctuate between periods of being merely annoying and periods of being barely tolerable. My guess was that Alphabet/Google kept changing/tweaking how it coded its "problem sites" behind the scenes, sometimes resulting in "better" performance in Pale Moon, sometimes resulting in worse. But it was just a guess, based on the fact that I haven't changed my computer settings or Pale Moon configuration in any significant way other than promptly updating to the latest version of Pale Moon. Same plain-vanilla Windows Defender, same extensions (totaling 70MB RAM usage), same pinned tabs, pretty much the same uBlock Origin subscriptions, yada, yada, yada…