high load in absence of anything open (one window, blank tab)

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!
User avatar
yury_700
Moongazer
Moongazer
Posts: 14
Joined: 2020-12-09, 14:58

high load in absence of anything open (one window, blank tab)

Unread post by yury_700 » 2024-01-17, 19:14

The browser hits a very high cpu load (around 100%) and memory usage (up to 2g RES in top output) when nothing is open (one window, blank tab), however that happens after some browsing. I didn't manage yet to determine what site (or sites) is causing the behaviour. How do I determine what component is causing the offending behaviour?

Operating system: linux
Browser version: 32.5.2
32-bit or 64-bit browser?: 64
Problem URL: n/a
Browser theme (if not default):milestone 10
Installed add-ons: rather a lot of them, don't know how to get a list automatically
Installed plugins: (about:plugins):

If possible, please include the output of help->troubleshooting information (as text):
**PASTE troubleshooting information here**

Potkeny
Fanatic
Fanatic
Posts: 132
Joined: 2018-08-03, 17:00

Re: high load in absence of anything open (one window, blank tab)

Unread post by Potkeny » 2024-01-17, 19:34

yury_700 wrote:
2024-01-17, 19:14

Installed add-ons: rather a lot of them, don't know how to get a list automatically
I think this might be helpful for that:
yury_700 wrote:
2024-01-17, 19:14
If possible, please include the output of help->troubleshooting information (as text):

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

Re: high load in absence of anything open (one window, blank tab)

Unread post by Moonchild » 2024-01-17, 20:50

we do need your troubleshooting info to know what's up.
In addition, please make a memory report when you are experiencing high CPU and high memory:
  1. open about:memory in a new tab
  2. Click the "measure and save" button
  3. Attach the resulting .gz to your reply (or send a private message to me with it attached if you're worried about your visited URLs that might show 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
yury_700
Moongazer
Moongazer
Posts: 14
Joined: 2020-12-09, 14:58

Re: high load in absence of anything open (one window, blank tab)

Unread post by yury_700 » 2024-01-18, 04:14

Thank you guys for your prompt answers. I'm now waiting for the issue to happen.

User avatar
yury_700
Moongazer
Moongazer
Posts: 14
Joined: 2020-12-09, 14:58

Re: high load in absence of anything open (one window, blank tab)

Unread post by yury_700 » 2024-01-22, 04:29

Finally ran into the issue again. It wasn't as severe as in the previous cases ("cpu at 100% plus"), the cpu load was oscillating "just" between 20-25% and 75%, with one window and one blank tab -- after perusing some tabs which were visibly heavy on cpu some time before.
I'm attaching the requested info. The about:support was saved in ODT, and memory report was saved with 'anonymized' checked.
You do not have the required permissions to view the files attached to this post.

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

Re: high load in absence of anything open (one window, blank tab)

Unread post by Moonchild » 2024-01-22, 08:07

"anonymized" memory report does not help us pin down exactly what has been causing the issue for you... (it's why I asked to PM it to me if you didn't want to post publicly)

The only thing that can be gleaned from it is thatit's been a ghost window causing the issue for you (many objects taking up >250 MB of memory, likely with a ton of event handlers activew eating CPU) but no indication which site caused the ghost window for our investigation. So it's really not that useful, I'm afraid.

Also, I can't do anything with an open document template. just use plaintext, please.
"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
yury_700
Moongazer
Moongazer
Posts: 14
Joined: 2020-12-09, 14:58

Re: high load in absence of anything open (one window, blank tab)

Unread post by yury_700 » 2024-01-23, 04:29

Moonchild wrote:
2024-01-22, 08:07
"anonymized" memory report does not help us pin down exactly what has been causing the issue for you... (it's why I asked to PM it to me if you didn't want to post publicly)
You could've mentioned that then, about that checkbox destroying information's utility. ))
I thought you've just forgotten about that checkbox (not mentioning it in any way). And so decided checking it wouldn't hurt.
Should've made two instances, of course. And there even wasn't anything sensitive there. ))
ODT isn't a template, just an OpenOffice/LibreOffice document. Trouboleshooting info has tables in it.

Are there any easy clues as to how to detect a ghost window appearance? Maybe I'm getting it more often than I think, PM feels sort of sluggish from time to time.

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

Re: high load in absence of anything open (one window, blank tab)

Unread post by Moonchild » 2024-01-23, 09:47

yury_700 wrote:
2024-01-23, 04:29
ODT isn't a template, just an OpenOffice/LibreOffice document.
Ah okay I confused it with .ott then. I thought it stood for "OpenDocument Template".
Either way i don't have OpenOffice/LibreOffice so i can't use it.
yury_700 wrote:
2024-01-23, 04:29
You could've mentioned that then, about that checkbox destroying information's utility. ))
I thought you've just forgotten about that checkbox (not mentioning it in any way). And so decided checking it wouldn't hurt.
Yeah i'm sorry for not explicitly mentioning it.
"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
yury_700
Moongazer
Moongazer
Posts: 14
Joined: 2020-12-09, 14:58

Re: high load in absence of anything open (one window, blank tab)

Unread post by yury_700 » 2024-02-04, 16:30

Finally got the situation again. It seems to be triggered by some sorts of use of vk.com social network. Maybe picture clicking, i.e. opening?
I'm attaching report files, hopefully in the correct formats this time. ))
I've got gc-edges and cc-edges too, but those are too large to attach. Let me know if you need those.
You do not have the required permissions to view the files attached to this post.

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

Re: high load in absence of anything open (one window, blank tab)

Unread post by Moonchild » 2024-02-04, 17:06

Yeah the problem is ghost windows, i.e. tabs you've closed but that have created structures so large or complex that the garbage collector can't clean them up. Specifically both vk.com and github.com are causing this, causing leaked/detached event handlers (several thousand of them each!) that just keep spinning the event loop with no work done and since they are still "live", the garbage collector can't clean them as there's a limit to how deep it will trace when trying to decide if something can be tossed.

Ultimately this is bad website design (most likely circular dependencies), aided by opaque technologies like shadow dom and web workers that by design have to run de-coupled from page content, that other browsers avoid the symptoms of because they throw the baby out with the bath water (multi-process doesn't care if its a mess, as it doesn't try to do normal garbage collection and just kills the process that had the tab loaded, effectively the same as if you'd restart the browser after every site visit). There isn't really all that much we can do about it and you should just restart the browser if this occurs.
"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
yury_700
Moongazer
Moongazer
Posts: 14
Joined: 2020-12-09, 14:58

Re: high load in absence of anything open (one window, blank tab)

Unread post by yury_700 » 2024-02-04, 20:02

Moonchild wrote:
2024-02-04, 17:06
There isn't really all that much we can do about it and you should just restart the browser if this occurs.
Thank you very much, that was well explained, I've even understood almost all of that, excepting matters of modern webapps design, which is quite unfamiliar to me.

However, 'empty' browser BEFORE restart has available e.g. references to not-yet-cleared history, which might prove useful in some cases. After restart there's nothing.
So, if it's an unavoidable issue -- maybe introduce a function/button to forcibly clear 'extraneous' processes, sort of like I'm clearing apps in my android phone?

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

Re: high load in absence of anything open (one window, blank tab)

Unread post by Moonchild » 2024-02-04, 20:32

yury_700 wrote:
2024-02-04, 20:02
However, 'empty' browser BEFORE restart has available e.g. references to not-yet-cleared history, which might prove useful in some cases. After restart there's nothing.
So, if it's an unavoidable issue -- maybe introduce a function/button to forcibly clear 'extraneous' processes, sort of like I'm clearing apps in my android phone?
I don't know what you mean. If you opt to restart the browser there will be no "extraneous" processes because Pale Moon is not multi-process. There is nothing to clear. If you restart the browser, it will have a clean slate without any cruft in memory from your previous session. So I'm not sure what you are asking for here.
"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
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: high load in absence of anything open (one window, blank tab)

Unread post by athenian200 » 2024-02-04, 22:14

yury_700 wrote:
2024-02-04, 20:02
However, 'empty' browser BEFORE restart has available e.g. references to not-yet-cleared history, which might prove useful in some cases. After restart there's nothing.
So, if it's an unavoidable issue -- maybe introduce a function/button to forcibly clear 'extraneous' processes, sort of like I'm clearing apps in my android phone?
Well, the problem as far as I see it is that since Pale Moon isn't multi-process, there's nothing that can "stay alive" while memory is cleared within the Pale Moon process. So in other words, a full browser restart seems to be required to clear the memory of leaked event handlers, due to some kind of limitation of garbage collection.

Ideally, it seems like it would be good if there were somehow a dumb, sweeping way to manually "hard reset" all the memory allocated to the browser that isn't needed to keep the browser process alive, without a full restart or a dependency on the garbage collector to work properly.

I will have to admit that not being multi-process has been a trade-off. It makes the browser more secure and more compatible with XUL extensions, but at the cost of needing a lot more browser restarts and not having a way to recover from issues that modern websites to create rather frequently due to their excessive use of RAM. Not gonna lie, there's definitely a reason the other browsers did what they did, as many drawbacks as it has.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
suzyne
Lunatic
Lunatic
Posts: 364
Joined: 2023-06-28, 22:43
Location: Australia

Re: high load in absence of anything open (one window, blank tab)

Unread post by suzyne » 2024-02-05, 00:02

I get the high cpu usage when visiting some sites, and it remains high even when the tabs are closed. I know that what I do isn't a "solution", but I have learnt to avoiding visiting some sites (thinking of you outlook.com) or use the the very convenient Restart command in the File menu.
Laptop 1: Windows 10 64-bit, i7 @ 2.80GHz, 16GB, NVIDIA GeForce MX450.
Laptop 2: Windows 10 32-bit, Atom Z3735F @ 1.33GHz, 2GB, Intel HD Graphics.

User avatar
yury_700
Moongazer
Moongazer
Posts: 14
Joined: 2020-12-09, 14:58

Re: high load in absence of anything open (one window, blank tab)

Unread post by yury_700 » 2024-02-05, 06:37

Moonchild wrote:
2024-02-04, 20:32
If you opt to restart the browser there will be no "extraneous" processes because Pale Moon is not multi-process. There is nothing to clear. If you restart the browser, it will have a clean slate without any cruft in memory from your previous session. So I'm not sure what you are asking for here.
I'd like an option of cutting the cruft forcibly without browser restart. Let it be available only if the browser window has one blank tab. Can it be done? Or is it too specific a scenario?

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

Re: high load in absence of anything open (one window, blank tab)

Unread post by Moonchild » 2024-02-05, 07:00

yury_700 wrote:
2024-02-05, 06:37
I'd like an option of cutting the cruft forcibly without browser restart. Let it be available only if the browser window has one blank tab. Can it be done? Or is it too specific a scenario?
It's not possible to do that because of the complexity of the JS engine and its garbage collector. Basically what you're asking us to do is create something that "empties the garbage bag one piece at a time" instead of just tossing the garbage bag and start with a new one.
What is the resistance against just hitting the Pale Moon button/file menu and clicking "restart"? If you already closed all tabs, then a restart won't really be significantly different than somehow cutting away everything that was allocated but keeping the process running.
"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
yury_700
Moongazer
Moongazer
Posts: 14
Joined: 2020-12-09, 14:58

Re: high load in absence of anything open (one window, blank tab)

Unread post by yury_700 » 2024-02-05, 07:13

Moonchild wrote:
2024-02-05, 07:00
It's not possible to do that because [...]
Understood, thank you all the same.

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

Re: high load in absence of anything open (one window, blank tab)

Unread post by Moonchild » 2024-02-05, 07:16

athenian200 wrote:
2024-02-04, 22:14
Ideally, it seems like it would be good if there were somehow a dumb, sweeping way to manually "hard reset" all the memory allocated to the browser that isn't needed to keep the browser process alive
That can be done but would require a shutdown and restart of the JS engine (basically power cycling the JS engine) but the shutdown and startup processes that are needed in that case would only differ from a browser restart in that it doesn't actually close the shell process. Keep in mind our JS engine is also what drives our UI. Something like that would "fake" not restarting but for all intents and purposes would still restart all the processes inside the browser; and that comes with a whole bunch of other issues in and of itself e.g. some drivers might not like a process attempting to restart its internals and re-initialize without the OS being flagged to do janitorial stuff.
I mean... there's definitely some way we can research that does this half shutdown and reboot internally (maybe keeping things like networking alive or what not) but there's no strict separation between js and C++ in our code base when it comes to internal processes; we implement a good number of DOM features in self-hosted JS, for example. To me, as an initial, that feels like opening a whole can of worms.
athenian200 wrote:
2024-02-04, 22:14
I will have to admit that not being multi-process has been a trade-off.
Of course it has been. There are certainly positives to running multi-process but they are almost entirely high-level considerations like offloading process security to the OS and just tossing out entire containers because the "modern web" is such a disaster in terms of being manageable programmatically (which causes our need for the occasional restart). And I think the technical drawbacks to it are terrible. Did you know that in the last 6 months in my sec audits, at a minimum there were 27 sec-high bugs that were solely and directly related to e10s? And that this is a big reduction from what it used to be? How many years ago was this introduced again... and it's still causing massive security issues by its very nature...
"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
poefirestorm
Moongazer
Moongazer
Posts: 7
Joined: 2023-07-20, 23:29

Re: high load in absence of anything open (one window, blank tab)

Unread post by poefirestorm » 2024-03-03, 10:28

Moonchild wrote:
2024-02-04, 17:06
the garbage collector can't clean them as there's a limit to how deep it will trace when trying to decide if something can be tossed.
is this gc depth limit configurable somewhere in the browser properties?

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

Re: high load in absence of anything open (one window, blank tab)

Unread post by Moonchild » 2024-03-03, 11:00

poefirestorm wrote:
2024-03-03, 10:28
is this gc depth limit configurable somewhere in the browser properties?
No. And even if it was I'm pretty sure it wouldn't help much.

A while back I looked at somehow tagging ghost windows and forcing them to be nuked but wasn't able to come up with a reasonable implementation. I may revisit that sometime.
"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