browser constantly hangs for brief moments

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
disconect

Re: browser constantly hangs for brief moments

Unread post by disconect » 2021-04-05, 22:23

New Tobin Paradigm wrote:
2021-04-05, 21:54
Why don't you try a mail client instead? I know of one ;)
LOL. I use that particular client for my work emails, this is my personal email that I'm checking at work. I'd rather not set that up in Outlook to where those emails get downloaded to my work computer and mixed up with work. Since there's no real reason for me to check my email at work anyway, I think I can do without doing it at all, or I can just do it on my phone if I really have to.

New Tobin Paradigm

Re: browser constantly hangs for brief moments

Unread post by New Tobin Paradigm » 2021-04-05, 22:33

Should you be checking personal email at work, though? Maybe we should ask your boss or IT department.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4968
Joined: 2015-12-09, 15:45
Contact:

Re: browser constantly hangs for brief moments

Unread post by moonbat » 2021-04-05, 23:57

Best to avoid personal use of office internet, even more so now that smartphones are a thing and you can have your mail notified on that if required.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

Hugga

Re: browser constantly hangs for brief moments

Unread post by Hugga » 2021-04-06, 00:23

Kris_88 wrote:
2021-04-05, 15:38

I guess it is GC/CC cycles.
We can investigate this using the simpe gc/cc monitor.

Maybe you will find the relationship between hangs and GC/CC events.
I tried this today after waking from sleep, and yes I personally see a relationship.

I don't know what CC is, but when there was a hang, the CC number would change immediately after the hang. There was no (significant) hang with a GC garbage collection number change.

After restart the CC numbers are sub-100, and change without hang.

Thanks for the script. I'm going to watch it for a few days. What is CC and is there some tuning we can try?

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 935
Joined: 2021-01-26, 11:18

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-06, 00:34

disconect wrote:
2021-04-05, 20:49
Now the numbers are GC: 476/476 CC: 4376/2365. A few minutes ago when I took a screenshot they were GC: 423/423 CC: 5178/3122.
Thus, we have a memory leak and freezes for 2-3 seconds.

The next step for a deeper investigation is the information from the about: memory page (memory reports, GC and CC logs). And some useful log analysis tools:
https://bugzilla.mozilla.org/show_bug.cgi?id=466157
This is for developers...

New Tobin Paradigm

Re: browser constantly hangs for brief moments

Unread post by New Tobin Paradigm » 2021-04-06, 00:36

Well let us know when you have a fix to contribute.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 935
Joined: 2021-01-26, 11:18

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-06, 00:50

New Tobin Paradigm wrote:
2021-04-06, 00:36
Well let us know when you have a fix to contribute.
It's quite difficult, Tobin,
and it takes a long time ...

New Tobin Paradigm

Re: browser constantly hangs for brief moments

Unread post by New Tobin Paradigm » 2021-04-06, 00:52

I understand :)

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 935
Joined: 2021-01-26, 11:18

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-06, 04:29

Hugga wrote:
2021-04-06, 00:23
What is CC and is there some tuning we can try?
CC (Cycle Collector) is looking for unreachable chains of objects that can be released. It must go through all the objects, and the problem occurs when there are many of them, but they cannot be released. Then attempts will be made again and again.
This is not necessarily the problem of the browser itself. It can be extensions.
We need to look for the cause of the problem or accept it...

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2188
Joined: 2018-05-05, 13:29

Re: browser constantly hangs for brief moments

Unread post by vannilla » 2021-04-06, 11:36

Hey, looks like the problem is really poorly optimized websites, like I hypotesized on page 1!
If the issue is really objects not bein released, then isn't that a known problem?
This kind of leak actually happens on Firefox and Chrome too; the difference is that those two completely nuke everything after certain actions and sometimes indiscriminately crash in the background, while Pale Moon tries to be more conservative (and certainly can't just arbitrarily crash.)
Needless to say, with how Chrome handles this whole deal created by junk frameworks, nobody really discovers those leaks unless they use UXP.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 935
Joined: 2021-01-26, 11:18

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-06, 12:57

vannilla wrote:
2021-04-06, 11:36
Hey, looks like the problem is really poorly optimized websites, like I hypotesized on page 1!
If the issue is really objects not bein released, then isn't that a known problem?
Memory leak can be in more than one place.
No matter how badly the site was made, all objects should be released when the tab is closed:
disconect wrote:
2021-04-05, 20:49
I have been able to duplicate the problem after a restart by opening my email in a tab, closing that tab, and then doing anything else. I did this once and the problem started happening in a mild way (the second CC number went from single or double digits up to 500), and then I did it again (opening and closing my email) without a restart, and the problem manifested in its more severe form.

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2188
Joined: 2018-05-05, 13:29

Re: browser constantly hangs for brief moments

Unread post by vannilla » 2021-04-06, 13:31

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:
That's not how it works.
When a tab is closed things are kept in memory for a while and will be disposed of in due time.
The approach you are describing is the one used by Chrome, where the whole process handling the tab is killed with no remorse, thus hiding the leak.
Firefox also completely destroys the process, though the internals are handled differently than Chrome for those who want to be precise.
Pale Moon, in virtue of not having the multiprocess monstrosity that enabled these leaks to be present in the first place, ends up showing the leaks, instead of putting the dust under the carpet.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 935
Joined: 2021-01-26, 11:18

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-06, 13:42

vannilla wrote:
2021-04-06, 13:31
That's not how it works.
When a tab is closed things are kept in memory for a while and will be disposed of in due time.
I'm not talking about the memory release. I say that objects are disconnected from the root and there is nothing to do for the СС again and again. The actual release of the memory can indeed happen much later.

disconect

Re: browser constantly hangs for brief moments

Unread post by disconect » 2021-04-06, 19:09

Kris_88 wrote:
2021-04-06, 00:34
Thus, we have a memory leak and freezes for 2-3 seconds.

The next step for a deeper investigation is the information from the about: memory page (memory reports, GC and CC logs). And some useful log analysis tools:
https://bugzilla.mozilla.org/show_bug.cgi?id=466157
This is for developers...
When you say "this is for developers" are you referring to just the link at the end, or the whole post? Because I ended up needing to get into my personal email for a legit work reason and can post the info from about:memory if that would be helpful. I haven't closed the tab yet - would you want me to do about:memory as soon as the problem starts happening, or wait a while...?

[PCMartin]

Re: browser constantly hangs for brief moments

Unread post by [PCMartin] » 2021-04-06, 21:26

disconect wrote:
2021-03-24, 19:11
I've noticed a problem where about every 20 seconds or so the browser will "hang" for maybe 2-5 seconds.
vannilla wrote:
2021-03-24, 19:16
[D]o you visit particular websites when that happens?
I had the same problem as the original poster — sometimes with longer hangs and with typing/click input that didn't get buffered and was lost instead — and I've definitively confirmed that Gmail and YouTube were the source of my hangs:
  • If I never load Gmail or YouTube during a given session, Pale Moon behaves normally.
  • If I load any Gmail or YouTube tabs during a given session, the hangs start occurring on all tabs (whether Gmail/YouTube or not).
  • The more Gmail/YouTube tabs I've loaded during a browsing session, the worse the problem gets: Gmail and YouTube seemingly load "zombie blobs" into RAM that don't get flushed until I exit (or restart) Pale Moon. Closing or unloading the offending Gmail/YouTube tabs has no effect. The recalcitrant blobs just keep increasing Pale Moon's RAM usage and keep causing hangs until I end the session.
I began noticing the recurring-hang problem at least several months ago (maybe even a year ago), to a somewhat lesser degree, but it became so intolerable in the past couple of weeks that I finally got serious about identifying and eliminating the culprit — which I did around a week ago. (I would have posted earlier, but the forum was down for language maintenance.)

For now, I've been forced to move my Gmail and YouTube browsing from Pale Moon to Brave (where those sites join Netflix and a handful of other ill-behaved sites). Pale Moon is once again performing very nicely, but I don't like fragmenting my general browsing history across multiple browsers. (I rely on history very heavily to revisit sites/pages/videos that were often pretty difficult to find in the first place. Some of them may even have been significantly downranked in search results in the ensuing time. I don't mind splitting off Netflix history, but for pretty much everything else, I do.)

At any rate, whatever coding shenanigans Alphabet/Google is pulling behind the scenes in Gmail and YouTube, I hope Pale Moon's developers can find a way to neutralize them. Pale Moon is still my favorite browser by a long shot and I want to hold onto it as my default/primary browser for as long as I can.

BACKGROUND:
  • User Technical Proficiency: Ordinary non-coder, non-webmaster user
  • CPU: 10th Generation i7
  • Discrete GPU: N/A (integrated graphics only)
  • Typical Free CPU Overhead: ~90%
  • Total RAM: 16 GB
  • Typical Free RAM: ~8 GB
  • Onboard Storage: 0.5 TB NVMe SSD
  • Typical Free Onboard Storage: ~50% = 0.25 TB
  • Effective Downstream Internet Bandwidth (from router): 600 Mbps
  • OS: Windows 10 1909
  • Pale Moon 29.1.1 (64-bit) for Windows
  • Pale Moon cache set to zero
  • uBlock Origin with healthy complement of filter subscriptions
  • eMatrix with scripting enabled only to the point of permitting site functionality
  • A healthy complement of other extensions, including Lull The Tabs
Conceivably, my recurring-hang problem may involve my ad-blocking, my script-blocking, my zero-size cache (?), or one or more of my other extensions, but for now, I can definitively state that loading Gmail or YouTube tabs is what triggers the hangs. I've read here and there that some other sites (Twitter?) may cause similar problems, and I think (but haven't confirmed) that I've personally run into them at TomsHardware and affiliated sites, but for days now, I've been browsing in Pale Moon trouble-free — so long as I never load Gmail or YouTube.

PS: I'm sorry I don't have the background to technically diagnose what's going on. I hope that putting the spotlight on Gmail and YouTube is at least a useful starting place.

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2188
Joined: 2018-05-05, 13:29

Re: browser constantly hangs for brief moments

Unread post by vannilla » 2021-04-06, 22:01

Yes, it's a known situation.
It's because of Google's frameworks (and competitors following) in your specific case, and 99% in the OP's case too.
And as I also said: this issue actually happens in other browsers too, but those browsers hide the fact using smokes and mirrors. You notice it on Pale Moon because it doesn't hide anything.
And 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.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 935
Joined: 2021-01-26, 11:18

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-07, 08:42

disconect wrote:
2021-04-06, 19:09
I haven't closed the tab yet - would you want me to do about:memory as soon as the problem starts happening, or wait a while...?
I will try to reproduce the problem. Logs must be taken at the right moment, otherwise there will be a lot of unnecessary information.
I will inform when there will be any results.

disconect

Re: browser constantly hangs for brief moments

Unread post by disconect » 2021-04-07, 15:05

[PCMartin] wrote:
2021-04-06, 21:26
I can definitively state that loading Gmail or YouTube tabs is what triggers the hangs.
I just tested it on mine with several YouTube tabs and Gmail. It seems like closing any of those tabs causes my CC numbers to spike (up to maybe 1600 for the first number, maybe up to 100 for the 2nd) but only for a brief moment, then they go back down. So it seems like those sites cause the same problem I was having with Outlook, but Pale Moon is able to fix itself, I guess. I do not notice any scrolling problems or other hang symptoms, I just see the numbers spike and go down, so (personally) wouldn't have even known those sites were a problem without having the GC/CC numbers displayed (following the directions earlier in the thread).

Also, somehow I forgot to mention, that I have had this happen to me using Firefox on my late-2013 iMac at home, but very rarely. Maybe twice in the year I've been using it. My usage there is quite different, in that I will have 8-10 windows, or more, open with a total of 150 or more tabs, and I almost never shut the computer off or close Firefox, but put the computer to sleep, so Firefox is running for perhaps several weeks like this before that problem manifests. It is corrected by a restart. I mention this because I've seen it mentioned that other browsers have this same problem but cover it up, and it seems that I have seen the cover up fail occasionally. Maybe that was an interesting/useful anecdote, maybe not.

Thanks again to everyone for their help! :thumbup:

User avatar
OmegaPaladin
Hobby Astronomer
Hobby Astronomer
Posts: 18
Joined: 2020-09-21, 21:26

Re: browser constantly hangs for brief moments

Unread post by OmegaPaladin » 2021-04-07, 15:40

I have noticed this behavior more commonly recently. Typically I will have outlook.com open, along with box and a few company specific websites. Very typically, Pale Moon will use 25-30% during the brief hangs.

Are there any extensions that track CPU usage by tab?

New Tobin Paradigm

Re: browser constantly hangs for brief moments

Unread post by New Tobin Paradigm » 2021-04-07, 15:47

As you should know.. UXP Applications are single process and no such measurement is possible.

Locked