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-03-29, 19:21

person45 wrote:
2021-03-29, 03:08

I'd like to hear from the original poster if he or she has any more clues about the issue.
I don't have much to add at this point. I can say that my CPU does not go up to 100 when this is happening, although I did notice that the CPU use of Pale Moon increases by 5-10% each time while it is hung. I have been successful with restarting the browser when this is happening, that fixes it for a short while but it will inevitably start again. I don't have a huge number of tabs open, I've seen this happen with only 4 or 5 tabs, not doing intensive media stuff, either.

person45
Fanatic
Fanatic
Posts: 104
Joined: 2017-10-20, 07:00

Re: browser constantly hangs for brief moments

Unread post by person45 » 2021-03-29, 20:44

disconect wrote:
2021-03-24, 19:11
I reinstalled the browser yesterday and it seemed like it was going to work, but the problem has resurfaced today. I have not yet installed any add-ons.
Someone said that Firefox now separates scrolling from web processing.

Is it possible to make a palemoon2.exe that handles all the basic functions like typing, scrolling, right-clicking for a context menu, etc.? This secondary process can be fully contained and never connect to the internet, so it wouldn't compromise security. If people have multiple cores with hyperthreading, then offloading basic functions to an idle core would give the appearance of a smooth operation, even though there's a lot of processing behind the scenes.

This would just be a feature request. I'm guessing Pale Moon inherited a system that was originally tailored for a single core in the 2000s.

https://en.wikipedia.org/wiki/Pentium_4
"Pentium 4 is a brand by Intel for an entire series of single-core CPUs for desktops, laptops and entry-level servers. The processors were shipped from November 20, 2000, until August 8, 2008."

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

Re: browser constantly hangs for brief moments

Unread post by vannilla » 2021-03-29, 21:10

person45 wrote:
2021-03-29, 20:44
Is it possible to make a palemoon2.exe that handles all the basic functions like typing, scrolling, right-clicking for a context menu, etc.?
No.
Also, the security reports for the past three or so years coming from Firefox say hello.
They are there waiting for your separate process to open up enough holes.
The UI gains from a second process are severely outweighted by pretty much everything else.

person45
Fanatic
Fanatic
Posts: 104
Joined: 2017-10-20, 07:00

Re: browser constantly hangs for brief moments

Unread post by person45 » 2021-03-30, 21:18

vannilla wrote:
2021-03-29, 21:10
They are there waiting for your separate process to open up enough holes.
I'm confused. How does a script gain access to a separate process that never touches the webpage's data? For example, the keyboard's driver is handled by Windows, and the letters typed are pixels on the screen.

Pardon me for being ignorant because I'm not a programmer.
Last edited by person45 on 2021-03-30, 21:27, edited 1 time in total.

person45
Fanatic
Fanatic
Posts: 104
Joined: 2017-10-20, 07:00

Re: browser constantly hangs for brief moments

Unread post by person45 » 2021-03-30, 21:25

disconect wrote:
2021-03-29, 19:21
I did notice that the CPU use of Pale Moon increases by 5-10% each time while it is hung. I have been successful with restarting the browser when this is happening, that fixes it for a short while
I'm in the same boat. Restarting seems to be the only solution.

It's not the developer's responsibility to make patches for inefficient coding on websites, so I guess we just have to deal with it.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: browser constantly hangs for brief moments

Unread post by Moonchild » 2021-03-30, 21:32

person45 wrote:
2021-03-30, 21:18
I'm confused. How does a script gain access to a separate process that never touches the webpage's data? For example, the keyboard's driver is handled by Windows, and the letters typed are pixels on the screen.
Think about this for a minute. How would you interact with page content if it was fully separated? How could you click a link? How would a redirect update the URL bar? And for that matter: how would caching, networking, canvas and other parts of a web page work if the UI would have no link with the process that interacts with page content?
You'll find it to be a very tough set of questions to answer unless there is some kind of inter-process communication going on. And that is exactly where all the holes are opened up.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Plume
Moongazer
Moongazer
Posts: 13
Joined: 2020-10-22, 18:18

Re: browser constantly hangs for brief moments

Unread post by Plume » 2021-04-02, 20:56

Someone mentioned it happening on live.com, so I thought i'd share my experience. I was having a similar problem with small freezes. I was trying to figure out what was happening so I started loading the about:memory page and refreshing it a lot to see if I could see a pattern to why my Pale Moon memory usage was fairly high and I was having freezes. What I saw was that after checking my email on outlook.live.com Pale Moon would keep some references to outlook.live.com in memory and it would not get freed up even after closing the tab and waiting a long time. It wasn't a huge amount of memory, maybe 50-100 mb. But it also seemed to hinder the release of other tabs from memory after closing them. And since checking my email was pretty much always the first thing I did when opening my browser, it seemed like that was the thing that started the chain of freezes and high memory usage. 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, memory usage stays fairly reasonable and when I close tabs they seem to get released from memory very quickly.
I tried disabling addons and other customizations, but outlook.live.com still would affect my memory usage.
No idea if this is any help to troubleshooting, but thought I'd share it.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: browser constantly hangs for brief moments

Unread post by Moonchild » 2021-04-02, 21:33

it doesn't help troubleshooting but it does provide a potential workaround.
The problem is obviously that outlook.live.com is severely leaking objects and/or event handlers that aren't properly cleaned up by the scripting on the site. Of course this kind of poor website behaviour will be masked by other browsers if they just toss out the bucket with the bath water every time you close a tab, but there's not much we can do about it unless there is a very specific issue that is pointed out for us to look at.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

MoonPie

Re: browser constantly hangs for brief moments

Unread post by MoonPie » 2021-04-04, 19:11

I've only a posted (okay, whined) a time or two before.
Here I am again.
Came to complain about the pausing on pages, and find others have the same problem.

Currently Xenial Puppy Linux, Pale Moon 28.16.0 32-bit.
I even made a screen-capture video that shows the phenomenon, using PM, Firefox 72.0.2, and Chromium 52.0.2743.116
https://www.youtube.com/watch?v=5nJyOJ5dNdg

Odd thing is, it even happens when I'm not "on the web".
To get my comics reading fix, I have a local "page" of about 1200 lines (I only visit a dozen or so, I'm not completely insane) with just the HREF link, and a text description after it. That's it. No images, no JS, no nothing. Basically an HTML text file. PM even pauses just scrolling up and down through it, though only a couple of times, then it smooths out and acts normally.

Oh, and even typing in (pause...pause...pause...) this post, the pausing was as (pause...pause...pause...) irritating as ever.

User avatar
The Squash
Apollo supporter
Apollo supporter
Posts: 40
Joined: 2021-03-19, 19:39
Location: The Universe (?)

Re: browser constantly hangs for brief moments

Unread post by The Squash » 2021-04-04, 19:52

Off-topic:
Q: Does anybody else think that this thread, with its incredibly broad scope, is attracting too diverse commentary on almost totally unrelated issues?

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

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-04, 19:58

https://www.gocomics.com/luann/2021/04/02

Does not stop for me, very smooth scrolling.
29.1.1 64 Windows 8.1

User avatar
Tomaso
Board Warrior
Board Warrior
Posts: 1622
Joined: 2015-07-23, 16:09
Location: Norway

Re: browser constantly hangs for brief moments

Unread post by Tomaso » 2021-04-04, 20:11

Kris_88 wrote:
2021-04-04, 19:58
Does not stop for me, very smooth scrolling.
Try @ https://www.dagbladet.no/ instead.

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

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-04, 20:28

Tomaso wrote:
2021-04-04, 20:11
Try @ https://www.dagbladet.no/ instead.
The page is overloaded with pictures and videos. But it also scrolls normally.
There is a small pause on these objects:
https://www.dagbladet.no/images/7360479 ... ression=80
https://snipp.dbstatic.no/2021/04/03/91 ... _klem.webm

MoonPie

Re: browser constantly hangs for brief moments

Unread post by MoonPie » 2021-04-04, 22:00

Try @ https://www.dagbladet.no/ instead.

The page is overloaded with pictures and videos. But it also scrolls normally.
That's what's puzzling to me. It doesn't *always* do it.
That site scrolls fine for me too, as does Luann which I just revisited.
I also had the browser closed while doing other things.
Maybe there's some remnant of code from another site that's constantly checking something or trying to "call home" that doesn't get unloaded when its tab is closed, but only when the whole browser is closed?
I don't know... I'm just a lowly user, not a programmer.

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

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-04, 22:19

It is difficult for me to investigate the problem that I can not reproduce...

Hugga

Re: browser constantly hangs for brief moments

Unread post by Hugga » 2021-04-05, 10:28

I thought I would add my symptoms to the conversation.

I notice the same problem, not just in PM29 but at least back a couple of years (sorry, I never had a smooth experience with PM and assumed it was my laptop or extension so didn't pay much mind). I have Windows 10 64bit and PM 64bit, using a 10-year-old 2nd gen Intel Core i7-2670qm with HD Graphics 3000.

What I see more lately (at least on my host) is that after putting my laptop to sleep S3, the next day on wake the issue is most pronounced.

When present, it seems consistently every 20 seconds or so for about 5 seconds, so not random. It hangs the whole browser and I can't switch, create, or close any tabs for those few seconds, and thus affects scrolling on all tabs too. Like other posts, I don't have a "window is not responding" or anything showing CPU spikes etc. It doesn't affect any other apps on my computer and I can switch to other windows apps happily while PM hangs.

A browser restart then "fixes" it as suggested, until the next time it happens.

Although I do have some pinned tabs, I only use my laptop a few hours a day with just a few other tabs, but I do leave PM open. I do feel like the issue is always there lasting just microseconds, but becomes frustratingly noticeable (hanging a few seconds) after I've had a sleep/wake cycle and probably after browsing some heavy pages the day before. Unfortunately, I can't always force the issue by sleep/wake, so I'm sorry I can't be more helpful.

I'm gonna try out 32bit PM or Basilisk for a while and see what happens. :D

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: browser constantly hangs for brief moments

Unread post by Moonchild » 2021-04-05, 10:55

The "modern web" isn't really compatible with 10 year old hardware. Sleep mode implementations are also wildly different depending on hardware so it's quite possible you're hitting a bottleneck that causes hangs after suspend. Since we can't possibly fine-tune a generic browser for every possible hardware configuration out there, that's not something easily addressed and I just suggest you make it a habit of hitting that Restart menu entry if you put the computer to sleep and have issues when waking up.
Using a dedicated GPU instead of Intel's integrated "super basic" GPU with shared memory might also help lots. Pick up a dirt-cheap PCIe GPU like a lower end AMD one that is bus powered.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

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

Re: browser constantly hangs for brief moments

Unread post by Kris_88 » 2021-04-05, 15:38

Hugga wrote:
2021-04-05, 10:28
When present, it seems consistently every 20 seconds or so for about 5 seconds, so not random. It hangs the whole browser and I can't switch, create, or close any tabs for those few seconds, and thus affects scrolling on all tabs too.
A browser restart then "fixes" it as suggested, until the next time it happens.
I guess it is GC/CC cycles.
We can investigate this using the simpe gc/cc monitor.

1) Open about:config page, set "devtools.chrome.enabled" preference to true.
2) Open menu tools > web developer > scratchpad
3) Set "Environment" to "Browser"
4) Paste the script:

Code: Select all


var win = Components.classes["@mozilla.org/appshell/window-mediator;1"]
   .getService(Components.interfaces.nsIWindowMediator)
   .getMostRecentWindow('navigator:browser');
var par = win.document.getElementById('toolbar-menubar');
var elm = win.document.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'label');
par.appendChild(elm);


var ActivityFlag = false;
var LastFlag = true;
var gc = 'GC: ---';
var cc = 'CC: ---';

var timer = Components.classes["@mozilla.org/timer;1"]
             .createInstance(Components.interfaces.nsITimer); 
timer.initWithCallback(function() {
 if(LastFlag != ActivityFlag) {
   LastFlag = ActivityFlag;
   elm.style['background-color'] = ((LastFlag)?'#FF0000':null);
   elm.setAttribute('value', gc+' '+cc);
 };
 ActivityFlag = false;
}, 300, timer.TYPE_REPEATING_SLACK);


var Branch = Components.classes["@mozilla.org/preferences-service;1"]
 .getService(Components.interfaces.nsIPrefService)
 .getBranch('');
Branch.setBoolPref('javascript.options.mem.notify', true);


var ObserverService = Components.classes["@mozilla.org/observer-service;1"]
                      .getService(Components.interfaces.nsIObserverService);
var memObserver = {
  observe: function(aSubject, aTopic, aData){
    ActivityFlag = true;

    var i=0, j=0;

    if(aTopic == 'cycle-collection-statistics') {
      i = aData.indexOf('"duration":');
      j = aData.indexOf(',', i);
      if(i>=0 && j>=0) cc = 'CC: ' + Math.round(aData.slice(i+11, j).trim());
      i = aData.indexOf('"max_slice_pause":');
      j = aData.indexOf(',', i);
      if(i>=0 && j>=0) cc = cc + '/' + Math.round(aData.slice(i+18, j).trim());
    };

    if(aTopic == 'garbage-collection-statistics') {
      i = aData.indexOf('"total_time":');
      j = aData.indexOf(',', i);
      if(i>=0 && j>=0) gc = 'GC: ' + Math.round(aData.slice(i+13, j).trim());
      i = aData.indexOf('"max_pause":');
      j = aData.indexOf(',', i);
      if(i>=0 && j>=0) gc = gc + '/' + Math.round(aData.slice(i+12, j).trim());
    };

  },
  QueryInterface: function(iid){
    if (!iid.equals(Components.interfaces.nsISupports) &&
    !iid.equals(Components.interfaces.nsIObserver))
    throw Components.results.NS_ERROR_NO_INTERFACE;
    return this;
  }
};
ObserverService.addObserver(memObserver, "garbage-collection-statistics", false);
ObserverService.addObserver(memObserver, "cycle-collection-statistics", false);
5) Press "Run"

You will see an indicator that shows GC / CC events and time in milliseconds (total time / max pause):
scr21.png
Maybe you will find the relationship between hangs and GC/CC events.

disconect

Re: browser constantly hangs for brief moments

Unread post by disconect » 2021-04-05, 20:49

Thank you MoonPie, that video shows the exact same issue I'm having.

I think we're making progress. It didn't occur to me when I read it the first time that outlook.live.com is basically the same thing as what I use for my email - outlook.office.com. 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. 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.

I think I can at this point be almost certain that the problem occurs after closing my email. I don't know if there are other triggers, but this makes sense as I open it several times a day. I will try not going to my email at all for a while and see how long I can go without the problem resurfacing, and will report back what I find.
Last edited by Baloo on 2021-04-07, 17:29, edited 1 time in total.
Reason: Contained entire quote against forum rules, contained quote from another user while addressing someone else.

New Tobin Paradigm

Re: browser constantly hangs for brief moments

Unread post by New Tobin Paradigm » 2021-04-05, 21:54

Why don't you try a mail client instead? I know of one ;)

Locked