RAM Usage

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!
Glitch

RAM Usage

Unread post by Glitch » 2014-11-26, 00:18

I've been running Palemoon 25.1 for the past 24 hours. IN that time, the browser has somehow managed to consume over 2.5GB of RAM. I currently have 32 tabs open including about:memory and this tab. It's not addons as they are using less than 250MB. I've attached the memory report.

The browser keeps freezing up for about a second every 5-8 seconds while running GC routines. This is on a 6 core 4.4GHz CPU.

I've not seen memory usage anywhere close to this bad except with Chromium builds after version 28 and with Firefox before version 33. The reason I use this browser is because it is supposedly more thrifty than Firefox, but this does not seem to be the case.
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: 35647
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: RAM Usage

Unread post by Moonchild » 2014-11-26, 01:08

Thanks for your report. A quick look at the memory report showed a very likely reason for this memory use: Having a large number (more than 20) of tabs open on a *chan board in long threads that has a function to auto-update enabled by default.
Constantly updating positively huge pages with many images, animated gifs, and a good chunk of scripting (that probably doesn't exactly clean up after itself) like this one would be a prime setup for slowly increasing memory use. Once you hit a certain memory limit (especially for javascript-leaked elements) then the gc/cc can no longer properly do its job within acceptable limits, and will try to do a collection regularly to reclaim this memory (and failing if the pages don't release 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

Glitch

Re: RAM Usage

Unread post by Glitch » 2014-11-26, 02:21

That seemed to be exactly the case. I closed them and ran the series of memory reductions (minimize memory usage, cycle collection, and garbage collection) a few times which brought the memory usage down to just over 900MB. That's still pretty high considering I only have 10 tabs open now, but much better and much closer to what it should be. The garbage collector is also no longer constantly running. I attached the new memory emasurement to this post.

Thanks.
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: 35647
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: RAM Usage

Unread post by Moonchild » 2014-11-26, 17:25

Since your session has accumulated a lot of redundant data on the heap because of the reloads/updates, you can expect the session usage to remain relatively high until you restart Pale Moon and destroy the accumulated compartments and clear memory cache used. So that is to be expected after such a session run.
"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

Glitch

Re: RAM Usage

Unread post by Glitch » 2014-11-27, 04:16

Is fixing the bugs that cause this situation on the development roadmap? This never used to be an issue before Firefox 4 when Mozilla decided that they needed to be a chrome-copy of chrome and completely and utterly quit giving a shit how the browser performed and made each and every development at the expense of performance. I started using Firefox with V1.5 and never had to restart the browser because of memory allocation bugs until Firefox 7 or 8. Even after having it open for 2 or 3 weeks with numerous tabs with flash player, and opening and closing literally thousands upon thousands of other tabs, it never used more than a few hundred Megabytes of RAM when I brought the number of tabs back down to 3 or 4 dozen.

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

Re: RAM Usage

Unread post by Moonchild » 2014-11-27, 11:03

You can't compare Gecko 1.9 browsers with current browsers, nor can you compare websites "back then" with how they are created now.

The problem is not necessarily a bug in Pale Moon.
Automatically updating web pages (using AJAX or similar dynamic techniques like your chan site) require extreme care in how they are constructed, to make sure that previous content and scripting is properly dereferenced and freed up. If that's not done, then the page itself is being leaky, and the browser will dutifully keep the non-free things in memory, and eventually run into the situation where memory use warrants running the garbage collector, but the garbage collector can't do anything to the data because it's all still being referenced.
That kind of situation isn't easy nor straightforward to recover memory from, even after you close tabs out. Tabs and scripting aren't as isolated in the back-end as you might think, because of the very reasons you state has been sacrificed: performance. For example, it would be pointless to have the browser keep the same script from different tabs multiple times and keep separate copies of the compiled script in memory. Similarly, all tabs share a connection pool for HTTP connections to hosts, allowing individual tabs to re-use existing connections to the same server -- http is http, after all.

If you want you can try using Pale Moon 3.6.32 to visit your chan sites as an experiment, but I don't think you'll be very impressed with its performance.
"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