Basilisk 2022.08.06 - Memory Leak

Board for discussions around the Basilisk web browser.

Moderator: Basilisk-Dev

User avatar
fatboy
Astronaut
Astronaut
Posts: 556
Joined: 2017-12-19, 08:03
Location: Canada

Basilisk 2022.08.06 - Memory Leak

Unread post by fatboy » 2022-09-02, 15:46

Hi Folks,

I have discovered a memory leak in Basilisk for Linux.
Not exactly sure why, but when you open the link below, the ram usage skyrockets and the browser freezes.

https://waxisdead.com/shop/wax-is-dead-ceramic-foam/

Cheers,
your (fat)boy
Systemd Free - MX Linux, Antix Linux & Artix Linux

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

Re: Basilisk 2022.08.06 - Memory Leak

Unread post by Kris_88 » 2022-09-02, 15:56

This is not a memory leak.
This is a well-known problem in the mutation observer.

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

Re: Basilisk 2022.08.06 - Memory Leak

Unread post by Moonchild » 2022-09-02, 18:08

Kris_88 wrote:
2022-09-02, 15:56
This is a well-known problem in the mutation observer.
If it is what I think it is, then it's not a problem in the mutation observer code itself other than the fact that it doesn't forcefully terminate bad recursive use of mutation observers (website issue).
"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: 932
Joined: 2021-01-26, 11:18

Re: Basilisk 2022.08.06 - Memory Leak

Unread post by Kris_88 » 2022-09-02, 18:52

Moonchild wrote:
2022-09-02, 18:08
it's not a problem in the mutation observer code itself other than the fact that it doesn't forcefully terminate bad recursive use of mutation observers (website issue).
https://waxisdead.com/wp-content/cache/ ... 1659706780

Code: Select all

var targetMutation=$target[0],
config={attributes:!0,childList:!0,subtree:!0};
var callbackMutation=function(mutationsList,observer){for(var mutation of mutationsList){if('attributes'===mutation.type){$target[0].style.height='auto'}}};

var observer=new MutationObserver(callbackMutation);
observer.observe(targetMutation,config);
Moonchild, I am still at a loss with the final conclusion. On the one hand - yes, the website issue, on the other hand, there are too many sites with such a problem and browsers take this into account. Should Pale Moon take this into account too, or should we make websites correct the error? I don't know ... 50/50.

User avatar
Basilisk-Dev
Lunatic
Lunatic
Posts: 315
Joined: 2022-03-23, 16:41
Location: Chamber of Secrets
Contact:

Re: Basilisk 2022.08.06 - Memory Leak

Unread post by Basilisk-Dev » 2022-09-02, 19:44

Kris_88 wrote:
2022-09-02, 18:52
Should Pale Moon take this into account too, or should we make websites correct the error? I don't know ... 50/50.
Every now and then you might meet a site owner that cares about supporting Pale Moon (I have met two), but vast majority of websites have made it clear that they don't care about us at all. They usually only care about Chromium, Firefox, and Safari.
Basilisk Project Owner

viewtopic.php?f=61&p=230756

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

Re: Basilisk 2022.08.06 - Memory Leak

Unread post by Moonchild » 2022-09-02, 19:45

If you feel like providing code to dodge it in the browser itself, then by all means, go ahead. it should still throw a console warning at the very least to inform webmasters that they are Doing It Wrong™. if you don't feel that you're able to get this into the Observer C++ code, then a front-end patch would also work. In fact, I'd prefer an easy to update/maintain bit of code for this over digging into the DOM guts.
"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: 932
Joined: 2021-01-26, 11:18

Re: Basilisk 2022.08.06 - Memory Leak

Unread post by Kris_88 » 2022-09-08, 17:23

Yes, I looked at the sources. This problem is solved in FF, starting from version 63. There are many changes in the layout/style folder. Maybe later I can help a bit... not now.

User avatar
fatboy
Astronaut
Astronaut
Posts: 556
Joined: 2017-12-19, 08:03
Location: Canada

Re: Basilisk 2022.08.06 - Memory Leak

Unread post by fatboy » 2022-09-16, 22:42

I see Pale Moon show similar behaviour to Basilisk? It also has a memory leak on the same website?
Systemd Free - MX Linux, Antix Linux & Artix Linux

Locked