Limiting max RAM that Pale Moon can allocate

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!
xtal256
Moon lover
Moon lover
Posts: 95
Joined: 2014-06-22, 00:32
Location: here

Limiting max RAM that Pale Moon can allocate

Unread post by xtal256 » 2025-03-07, 00:21

I recently switched from 32-bit Pale Moon to 64-bit in the hope that the hanging and memory usage from leaky web pages would mitigated by having more memory available.
However, I just visited one page* and memory surged to 28GB and almost crashed my entire computer!
Is there a way I can limit the max RAM that Pale Moon is allowed to allocate? Maybe there is a setting in about:config to control how much memory the JavaScript engine is given, or some sort of config file with parameters that will be used by the exe when it starts up.

* (it was https://www.displayfusion.com/Support/, but memory had grown by that point so it may have just been the straw that broke the camels back)

Operating system: Windows 10 Pro, 22H2, 19045.5487
Browser version: 33.5.1
32-bit or 64-bit browser?: 64 bit

User avatar
Night Wing
Knows the dark side
Knows the dark side
Posts: 5398
Joined: 2011-10-03, 10:19
Location: Piney Woods of Southeast Texas, USA

Re: Limiting max RAM that Pale Moon can allocate

Unread post by Night Wing » 2025-03-07, 01:09

@ xtal256

Thanks for providing the link to the problem page you are having.

On the Display Fusion site, I am not noticing the memory spike you are seeing in your Windows 10 operating system. I also have 32 GB of memory. But I did see a large spike in CPU usage in my system on that page.

But I am not using the Windows 10 operating system which you use. I am using 64 bit linux Pale Moon 33.6.0.1 (GTK2) running in 64 bit linux Mint 22.1 (Xia) Xfce. Below is a screen shot of my system showing both Memory and CPU usage percentage wise.
You do not have the required permissions to view the files attached to this post.
Linux Mint 22.1 (Xia) Xfce w/Pale Moon, Waterfox, Firefox
MX Linux 23.6 (Libretto) Xfce w/Pale Moon, Waterfox, Firefox
Linux Debian 12.10 (Bookworm) Xfce w/Pale Moon, Waterfox, Firefox

BenFenner
Keeps coming back
Keeps coming back
Posts: 814
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: Limiting max RAM that Pale Moon can allocate

Unread post by BenFenner » 2025-03-07, 01:38

64-bit Windows and 64-bit Linux cannot be compared in this way. Windows has memory limits on both 32 and 64-bit versions that boggle the mind and confuse even seasoned professionals.

For example:
https://techcommunity.microsoft.com/dis ... to/1565518

Do we know if 64-bit Windows Pale Moon is compiled to be "large address aware"?
(From my experience it certainly doesn't seem like it.)

xtal256
Moon lover
Moon lover
Posts: 95
Joined: 2014-06-22, 00:32
Location: here

Re: Limiting max RAM that Pale Moon can allocate

Unread post by xtal256 » 2025-03-07, 02:16

Your link says that a 64-bit process without large address aware can only have 2GB of memory. Given that I saw it use over 10 times that amount, I think it's safe to say that Pale Moon is compiled to be large address aware.

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

Re: Limiting max RAM that Pale Moon can allocate

Unread post by Moonchild » 2025-03-07, 13:34

I think there's some confusion here. Large Address Aware compilation only applies to 32-bit applications. 64 bit applications have a huge address space natively. 32-bit applications don't because the max of 32-bit int is ~2G.
What LAA does is allow addressing beyond that numeric barrier on 64-bit operating systems. On 32-bit systems it can address up to the full 4GB hard limit in some configurations.

FTR, yes, 32-bit Pale Moon is compiled large address aware.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

BenFenner
Keeps coming back
Keeps coming back
Posts: 814
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: Limiting max RAM that Pale Moon can allocate

Unread post by BenFenner » 2025-03-07, 13:45

Moonchild wrote:
2025-03-07, 13:34
Large Address Aware compilation only applies to 32-bit applications.
Got a source on that? Everything I'm finding says otherwise, and I think this could be a big reason PM behaves the way it does on my Windows machines with regard to memory crunch (but not my Linux machine).
Last edited by BenFenner on 2025-03-07, 14:25, edited 1 time in total.

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

Re: Limiting max RAM that Pale Moon can allocate

Unread post by Moonchild » 2025-03-07, 13:53

Well, seems you can still force 64-bit applications into restricted 32-bit int space on Windows if you really, really, want to ;)
So I guess neither is accurate?
Microsoft wrote:The /LARGEADDRESSAWARE option tells the linker that the application can handle addresses larger than 2 gigabytes. In the 64-bit compilers, this option is enabled by default. In the 32-bit compilers, /LARGEADDRESSAWARE:NO is enabled if /LARGEADDRESSAWARE is not otherwise specified on the linker line.

If an application was linked with /LARGEADDRESSAWARE, DUMPBIN /HEADERS will display information to that effect.

Linking 64-bit applications with /LARGEADDRESSAWARE:NO is not recommended because it restricts the available address space, which can result in runtime failures if the app exhausts memory. It may also prevent x64 apps from running on ARM64 systems because the emulation runtime will try to reserve 4GB of virtual address space. If the app was linked with /LARGEADDRESSAWARE:NO, the app won't launch because it can't allocate that much address space.
Regardless, Pale Moon is compiled large address aware in either case. The modern web is very memory hungry because of the unloading of huge (often unnecessary) tasks to the browser for the web. Even so, 64-bit Pale moon happily uses way more than 4GB if requested. On 32-bit, the practical limit tends to be around 3GB because of other restrictions in a 32-bit process that also needs a lot of allocations for graphical display and threading.

so for OP's question, it is possible to restrict either to 2GB if you want, but be prepared for OOM crashes.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"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
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2818
Joined: 2012-08-19, 20:32

Re: Limiting max RAM that Pale Moon can allocate

Unread post by back2themoon » 2025-03-09, 15:56

Your problems on that website are most probably caused by Cloudflare. Block connections to: challenges.cloudflare.com and you should be fine.

xtal256
Moon lover
Moon lover
Posts: 95
Joined: 2014-06-22, 00:32
Location: here

Re: Limiting max RAM that Pale Moon can allocate

Unread post by xtal256 » 2025-03-09, 22:50

@Moonchild: I certainly don't want to limit it to just 2GB. The main reason why I moved from 32-bit Pale Moon to 64-bit was to try to avoid the hangs caused by pages using lots of memory. But I also don't want a single page to use all my available RAM and cause the entire operating system to hang/crash. Maybe this is more something that I can configure in the operating system, but a quick googling suggests that Windows does not have the ability to restrict max RAM for an application.

@back2themoon: I'm not sure of the consequences of blocking Cloudflare. Could you explain a little more about that, and what you think it is that Cloudflare is doing that would eat up memory?

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2818
Joined: 2012-08-19, 20:32

Re: Limiting max RAM that Pale Moon can allocate

Unread post by back2themoon » 2025-03-09, 22:56

Cloudflare major issues are all over the forum (and news):

viewtopic.php?f=65&t=32127
https://news.ycombinator.com/item?id=42953508
https://www.theregister.com/2025/03/04/ ... _browsers/
viewtopic.php?f=70&t=32091

etc.

Adding this below to uBO's rules (not filters) is the best thing you can do, for now.

Code: Select all

* challenges.cloudflare.com * block

xtal256
Moon lover
Moon lover
Posts: 95
Joined: 2014-06-22, 00:32
Location: here

Re: Limiting max RAM that Pale Moon can allocate

Unread post by xtal256 » 2025-03-10, 05:52

Hmm, yes, well Cloudflare issues aside my issue is still that a page can (under certain unknown circumstances) allocate over 28GB of RAM, way more that it legitimately needs to.

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2818
Joined: 2012-08-19, 20:32

Re: Limiting max RAM that Pale Moon can allocate

Unread post by back2themoon » 2025-03-10, 10:06

xtal256 wrote:
2025-03-10, 05:52
Hmm, yes, well Cloudflare issues aside my issue is still that a page can (under certain unknown circumstances) allocate over 28GB of RAM, way more that it legitimately needs to.
Your issue is Cloudflare. "Unknown circumstances"? Did you even try blocking it and visiting that page afterwards?

Enobarbous
Moon lover
Moon lover
Posts: 86
Joined: 2022-12-06, 17:44

Re: Limiting max RAM that Pale Moon can allocate

Unread post by Enobarbous » 2025-03-10, 18:23

xtal256 wrote:
2025-03-09, 22:50
Windows does not have the ability to restrict max RAM for an application.
I think you can try something along the lines of Process Governor. Although I haven't tried using it with a browser, it works with another software.

Upd. If we're talking about the solution at the browser level, you can try the Memory Restart extension (caa:addon/memory-restart or https://ca-archive.us.to/storage/249/24 ... .18-fx.xpi)...
I am sorry for the use of auto-translator to post

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

Re: Limiting max RAM that Pale Moon can allocate

Unread post by Moonchild » 2025-03-10, 19:17

Process Lasso worked well for me in the past when I needed something like that.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite