Reducing RAM possible

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
pm4eva
Moonbather
Moonbather
Posts: 74
Joined: 2018-06-12, 10:26
Location: CET

Reducing RAM possible

Unread post by pm4eva » 2023-01-18, 20:14

Hi, i am not sure if it would be possible to reduce RAM in the browser.
Is there a function that u could compress the cache in memory also for some things?
Or is there a solution to convert Pics to 256 colors automaticly while u surf normal pages?
Kind of Turbo Mode.
thx and greets

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

Re: Reducing RAM possible

Unread post by Moonchild » 2023-01-18, 23:49

Really not within our development scope. If you're that low on memory that you're considering asking this, maybe you should consider a hardware upgrade, also considering any of the things suggested would instead put a much heavier load on the CPU and if your memory is that low, then your CPU is likely also of considerable age so it'd basically be exchanging one bottleneck for another.
"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
andyprough
Astronaut
Astronaut
Posts: 701
Joined: 2020-05-31, 04:33

Re: Reducing RAM possible

Unread post by andyprough » 2023-01-19, 00:44

You can try the eMatrix extension - you can turn off all kinds of images, media, scripts, frames, css, etc, individually, for every site you visit, and save your preferences by site. https://addons.palemoon.org/addon/ematrix/

doofy
Astronaut
Astronaut
Posts: 650
Joined: 2017-08-14, 23:43

Re: Reducing RAM possible

Unread post by doofy » 2023-01-19, 02:14

If you have several tabs open, then unloading unused ones can help.
There's at least 3 unloaders I know of, 2 of which are on Pale Moon addons site.

User avatar
pm4eva
Moonbather
Moonbather
Posts: 74
Joined: 2018-06-12, 10:26
Location: CET

Re: Reducing RAM possible

Unread post by pm4eva » 2023-01-19, 17:56

@Moonchild

Yes both things would increase CPU load.
The thing is that some webpages uses JPEG pics and they are only small on disk but not in memory.
Do you know an option in about:config for rendering options what maybe decrease the ram usage?

@doofy

The only addon what worked was SUSPENDER but it seems all of those addons use only time specific unload.
The Firefox addon AUTO TAB DISCARD reduce memory if your ram becomes full.
I think thats a better solution than a time relevant option.
thx and greets

User avatar
random
Apollo supporter
Apollo supporter
Posts: 33
Joined: 2022-07-22, 06:31

Re: Reducing RAM possible

Unread post by random » 2023-01-19, 21:10

If your on Linux, you could use zram, which compresses RAM. It works quite well and it's better than swapping on disk.

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

Re: Reducing RAM possible

Unread post by Moonchild » 2023-01-19, 22:21

pm4eva wrote:
2023-01-19, 17:56
The thing is that some webpages uses JPEG pics and they are only small on disk but not in memory.
Do you know an option in about:config for rendering options what maybe decrease the ram usage?
That is not how display of images works. You cannot display the compressed data. You must decode and reconstruct the full-size red, green and blue channels of the image at the image's resolution and that simply takes a byte per channel and per pixel. Pale Moon already discards decoded images when they are not in view and re-decodes them when you bring them back into view (with some buffer) on sites with a lot of large images, so it already attempts to be resource-conscious within reason.

There are a few preferences you can try and tweak at your own risk to try and reduce image memory, but I can't provide detailed support for such setups. You'll have to tweak and tinker with it and see what is beneficial for your situation:

Code: Select all

// The maximum size, in bytes, of the decoded images we cache
pref("image.cache.size", 5242880);

// A weight, from 0-1000, to place on time when comparing to size.
// Size is given a weight of 1000 - timeweight.
pref("image.cache.timeweight", 500);

//
// Image memory management prefs
//

// Discards inactive image frames and re-decodes them on demand from
// compressed data.
pref("image.mem.discardable", true);

// Chunk size for calls to the image decoders
pref("image.mem.decode_bytes_at_a_time", 16384);

// Minimum timeout for expiring unused images from the surface cache, in
// milliseconds. This controls how long we store cached temporary surfaces.
pref("image.mem.surfacecache.min_expiration_ms", 60000); // 60s

// Maximum size for the surface cache, in kilobytes.
pref("image.mem.surfacecache.max_size_kb", 1048576); // 1GB

// The surface cache's size, within the constraints of the maximum size set
// above, is determined as a fraction of main memory size. The size factor is
// interpreted as a reciprocal, so a size factor of 4 means to use no more than
// 1/4 of main memory.  The default should be a good balance for most systems.
pref("image.mem.surfacecache.size_factor", 4);

// How much of the data in the surface cache is discarded when we get a memory
// pressure notification, as a fraction. The discard factor is interpreted as a
// reciprocal, so a discard factor of 1 means to discard everything in the
// surface cache on memory pressure, a discard factor of 2 means to discard half
// of the data, and so forth. The default should be a good balance for desktop
// and laptop systems, where we never discard visible images.
pref("image.mem.surfacecache.discard_factor", 1);
"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
pm4eva
Moonbather
Moonbather
Posts: 74
Joined: 2018-06-12, 10:26
Location: CET

Re: Reducing RAM possible

Unread post by pm4eva » 2023-01-20, 05:28

ok ty i will test some things
thx and greets

User avatar
pm4eva
Moonbather
Moonbather
Posts: 74
Joined: 2018-06-12, 10:26
Location: CET

Re: Reducing RAM possible

Unread post by pm4eva » 2023-01-20, 09:05

@Moonchild

Do you think i could use image.cache.size = 2621440 ?

p.s. the things i have changed til now are

image.mem.decode_bytes_at_a_time = 16384
image.mem.surfacecache.max_size_kb = 524288
image.mem.surfacecache.size_factor = 8
thx and greets

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

Re: Reducing RAM possible

Unread post by Moonchild » 2023-01-20, 09:32

pm4eva wrote:
2023-01-20, 09:05
Do you think i could use image.cache.size = 2621440 ?
You can, but 2.5 MB for a decoded image is fairly small (<1024x768). What you'd do with that is prevent larger images from being put into the image cache.
Moonchild wrote:
2023-01-19, 22:21
You'll have to tweak and tinker with it and see what is beneficial for your situation
"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
pm4eva
Moonbather
Moonbather
Posts: 74
Joined: 2018-06-12, 10:26
Location: CET

Re: Reducing RAM possible

Unread post by pm4eva » 2023-02-14, 10:59

ok ty
thx and greets

Locked