Memory use over the years: Mozilla

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.
tcaud

Memory use over the years: Mozilla

Unread post by tcaud » 2019-05-10, 07:47

Since upgrading my PC to a 16gb system from 4 gb, it's become very plain to me that Mozilla-based browsers are using more RAM than ever. I recalled using a system which had 512 mb RAM a decade ago and getting good performance, and I wondered to myself "how?" So I downloaded a series of portable versions of Firefox, starting with 2.0, and profiled the RAM usage of the exe (thru Win7 Taskman) to display a single website, Google.com.

Code: Select all


VER   RAM usage (kb) : Notes

2.0    36,982

3.5    34,556

3.6    33,316

4.0    63,500 : swings, volatility (120k)

10     68,000 : (cont., 60k) after mem optimization 65,000

20     96,000 : 500k volatile, after mem optimization 102,000

30     107,500 : 120k volatile; increase to 116,500 at idle, 3000k volatile;
                mem optimization ineffective.

40     123,000 : increase to 130,000 at idle.


66      580,000 : 100mb swings ; full installation, no add-ons

Palemoon 28: 156,000 : after mem optimization 148,500


The numbers speak for themselves. Between 3.6 and 4, RAM use doubled; then doubled again by 40, and by 66...

I looked at about:memory to get a sense of where this memory is going, and I think the culprit is the IonMonkey system. IonMonkey is a dynarec process which profiles script usage to try to figure out which scripts will benefit the user most as machine code. In theory it's a means to better performance, but in practice it just sucks up resources. Images are taking next to no memory compared to egregious Javascript buffering for rainy days that rarely arrive. In theory Mozzilla codebase is faster, but in practice you just spend more for less. And the "optimize memory" function? Totally ineffective.

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

Re: Memory use over the years: Mozilla

Unread post by Moonchild » 2019-05-10, 10:12

I can't speak for what Mozilla has done past our fork off point in terms of memory use (since they've been on a Rust-binge), but I can say something about IonMonkey and increased memory use of it as the web developed.
As it stands, JavaScript is a ridiculously large specification, so there's the base increase of memory use. Add to that the just ad egregious use (or abuse, if you will) of it on modern websites, and it's no surprise that in practice you see huge chunks of memory being in use by the JS engine when browsing as a result. Many pages in fact do load tons more JS than images, KB-wise. All of that being parsed and processed takes a pretty big factor more memory client-side once downloaded. Ultimately, JS was not designed to be used so heavily; as the name implies it's a scripting language, not a replacement for full application code languages like C++ or Java, but it has grown into just that. So, the browser is tasked to download, compile and run very large programs on a casual basis for many websites. Do you expect that to not use a lot of memory in the end?

Then as for IonMonkey and performance:
tcaud wrote:
2019-05-10, 07:47
IonMonkey is a dynarec process which profiles script usage to try to figure out which scripts the user will benefit the most from converting to machine code. In theory it's a means to better performance, but in practice it just sucks up resources.
If you want near-native execution speed with JavaScript, using a binary compiler for it is essential. That is not a theory. If you wish to put it to the test in practice, though, then I invite you to run Pale Moon in "interpreted" mode by disabling both the TraceMonkey and the IonMonkey engine (they are both parts of the JIT JavaScript compiler). In about:config, set javascript.options.baselinejit and javascript.options.ion to false (restart the browser after you change these options), and see where your performance goes on JS-heavy sites or with long-running programs. After that you can tell me if you still think it's "just sucking up resources".

EDIT: A quick test to show the level of difference: http://dromaeo.com/?id=277501,277502
"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

tcaud

Re: Memory use over the years: Mozilla

Unread post by tcaud » 2019-05-10, 10:39

Here's how Palemoon does with massive pages. Following is the about:memory dump for Palemoon when viewing my entire Facebook friends list (1491 users)

Code: Select all

460.83 MB (100.0%) -- explicit
├──208.66 MB (45.28%) -- window-objects
│  ├──185.78 MB (40.31%) -- top(https://www.facebook.com/anthony.carl.caudill/friends?lst=688745830%3A688745830%3A1557482689&source_ref=pb_friends_tl, id=427)
│  │  ├──145.21 MB (31.51%) -- active
│  │  │  ├──143.90 MB (31.23%) -- window(https://www.facebook.com/anthony.carl.caudill/friends?lst=688745830%3A688745830%3A1557482689&source_ref=pb_friends_tl)
│  │  │  │  ├───61.34 MB (13.31%) -- js-compartment(https://www.facebook.com/)
│  │  │  │  │   ├──52.40 MB (11.37%) -- classes
│  │  │  │  │   │  ├──22.37 MB (04.85%) -- class(Object)/objects
│  │  │  │  │   │  │  ├──15.73 MB (03.41%) ── gc-heap
│  │  │  │  │   │  │  └───6.64 MB (01.44%) -- malloc-heap
│  │  │  │  │   │  │      ├──5.92 MB (01.28%) ── slots
│  │  │  │  │   │  │      └──0.72 MB (00.16%) ── elements/normal
│  │  │  │  │   │  ├──14.16 MB (03.07%) -- class(Function)/objects
│  │  │  │  │   │  │  ├──12.88 MB (02.79%) ── gc-heap
│  │  │  │  │   │  │  └───1.29 MB (00.28%) ── malloc-heap/slots
│  │  │  │  │   │  ├──10.09 MB (02.19%) -- class(Array)/objects
│  │  │  │  │   │  │  ├───9.14 MB (01.98%) ── gc-heap
│  │  │  │  │   │  │  └───0.95 MB (00.21%) -- malloc-heap
│  │  │  │  │   │  │      ├──0.94 MB (00.20%) ── elements/normal
│  │  │  │  │   │  │      └──0.00 MB (00.00%) ── slots
│  │  │  │  │   │  └───5.78 MB (01.25%) ++ (12 tiny)
│  │  │  │  │   └───8.94 MB (01.94%) ++ (5 tiny)
│  │  │  │  ├───32.21 MB (06.99%) -- dom
│  │  │  │  │   ├──21.99 MB (04.77%) ── element-nodes
│  │  │  │  │   ├───6.94 MB (01.51%) ── orphan-nodes
│  │  │  │  │   └───3.27 MB (00.71%) ++ (4 tiny)
│  │  │  │  ├───30.96 MB (06.72%) -- layout
│  │  │  │  │   ├──12.58 MB (02.73%) -- (7 tiny)
│  │  │  │  │   │  ├───3.33 MB (00.72%) ── pres-contexts
│  │  │  │  │   │  ├───2.88 MB (00.63%) ── line-boxes
│  │  │  │  │   │  ├───2.02 MB (00.44%) ── style-structs
│  │  │  │  │   │  ├───1.50 MB (00.33%) ── pres-shell
│  │  │  │  │   │  ├───1.39 MB (00.30%) ── text-runs
│  │  │  │  │   │  ├───0.83 MB (00.18%) ── style-contexts
│  │  │  │  │   │  └───0.62 MB (00.14%) ── rule-nodes
│  │  │  │  │   ├──10.13 MB (02.20%) -- frames
│  │  │  │  │   │  ├───4.58 MB (00.99%) ── nsBlockFrame
│  │  │  │  │   │  ├───2.85 MB (00.62%) ── nsHTMLScrollFrame
│  │  │  │  │   │  ├───1.19 MB (00.26%) ── nsTextFrame
│  │  │  │  │   │  ├───0.50 MB (00.11%) ── nsInlineFrame
│  │  │  │  │   │  ├───0.48 MB (00.10%) ── nsPlaceholderFrame
│  │  │  │  │   │  ├───0.29 MB (00.06%) ── nsImageFrame
│  │  │  │  │   │  ├───0.17 MB (00.04%) ── nsFlexContainerFrame
│  │  │  │  │   │  ├───0.03 MB (00.01%) ── sundries
│  │  │  │  │   │  ├───0.02 MB (00.00%) ── nsBulletFrame
│  │  │  │  │   │  └───0.01 MB (00.00%) ── nsHTMLButtonControlFrame
│  │  │  │  │   └───8.26 MB (01.79%) ── style-sets
│  │  │  │  ├───19.00 MB (04.12%) ── style-sheets
│  │  │  │  └────0.38 MB (00.08%) ── property-tables
│  │  │  └────1.31 MB (00.28%) ++ (8 tiny)
│  │  └───40.57 MB (08.80%) -- js-zone(0x285f4000)
│  │      ├──11.70 MB (02.54%) -- shapes
│  │      │  ├──10.33 MB (02.24%) -- gc-heap
│  │      │  │  ├───5.96 MB (01.29%) ── tree
│  │      │  │  └───4.37 MB (00.95%) ++ (2 tiny)
│  │      │  └───1.37 MB (00.30%) ++ malloc-heap
│  │      ├───7.90 MB (01.71%) -- lazy-scripts
│  │      │   ├──6.04 MB (01.31%) ── gc-heap
│  │      │   └──1.86 MB (00.40%) ── malloc-heap
│  │      ├───7.36 MB (01.60%) ++ (8 tiny)
│  │      ├───6.84 MB (01.49%) ── type-pool
│  │      └───6.76 MB (01.47%) -- strings
│  │          ├──4.86 MB (01.05%) ++ string(<non-notable strings>)
│  │          └──1.91 MB (00.41%) ++ (56 tiny)
│  ├───15.94 MB (03.46%) -- top(about:memory, id=587)
│  │   ├──14.88 MB (03.23%) -- active/window(about:memory)
│  │   │  ├──11.96 MB (02.60%) -- dom
│  │   │  │  ├──11.93 MB (02.59%) ── orphan-nodes
│  │   │  │  └───0.03 MB (00.01%) ++ (5 tiny)
│  │   │  └───2.92 MB (00.63%) ++ (4 tiny)
│  │   └───1.07 MB (00.23%) ++ js-zone(0x1e273000)
│  ├────6.66 MB (01.45%) -- top(chrome://browser/content/browser.xul, id=3)
│  │    ├──5.36 MB (01.16%) -- active
│  │    │  ├──5.22 MB (01.13%) ++ window(chrome://browser/content/browser.xul)
│  │    │  └──0.14 MB (00.03%) ++ window(about:blank)
│  │    └──1.30 MB (00.28%) ++ js-zone(0x10fca000)
│  └────0.28 MB (00.06%) ++ top(resource://gre-resources/hiddenWindow.html, id=1)
├───70.82 MB (15.37%) -- js-non-window
│   ├──35.46 MB (07.69%) -- runtime
│   │  ├──14.50 MB (03.15%) ── script-data
│   │  ├──10.61 MB (02.30%) ── shared-immutable-strings-cache
│   │  ├───8.10 MB (01.76%) ── atoms-table
│   │  └───2.25 MB (00.49%) ++ (10 tiny)
│   ├──30.68 MB (06.66%) -- zones
│   │  ├──18.57 MB (04.03%) ++ zone(0x5b9d000)
│   │  ├──11.36 MB (02.46%) -- zone(0x5b6c000)
│   │  │  ├──10.44 MB (02.27%) -- strings
│   │  │  │  ├───9.58 MB (02.08%) -- string(<non-notable strings>)
│   │  │  │  │   ├──6.61 MB (01.43%) -- gc-heap
│   │  │  │  │   │  ├──6.61 MB (01.43%) ── latin1
│   │  │  │  │   │  └──0.01 MB (00.00%) ── two-byte
│   │  │  │  │   └──2.97 MB (00.64%) ++ malloc-heap
│   │  │  │  └───0.86 MB (00.19%) ++ (5 tiny)
│   │  │  └───0.91 MB (00.20%) ++ (5 tiny)
│   │  └───0.76 MB (00.17%) ++ (3 tiny)
│   └───4.68 MB (01.02%) ++ gc-heap
├───68.31 MB (14.82%) -- heap-overhead
│   ├──40.80 MB (08.85%) ── bin-unused
│   ├──20.36 MB (04.42%) ── page-cache
│   └───7.15 MB (01.55%) ── bookkeeping
├───49.05 MB (10.64%) ── heap-unclassified
├───21.97 MB (04.77%) ++ images
├───16.13 MB (03.50%) ++ (17 tiny)
├───13.16 MB (02.85%) -- workers
│   ├───9.15 MB (01.99%) -- workers(facebook.com)
│   │   ├──3.05 MB (00.66%) ++ worker(blob:https://www.facebook.com/09622903-85de-4f2e-8e04-eff744b9cdc3, 0x29abc800)
│   │   ├──3.05 MB (00.66%) ++ worker(blob:https://www.facebook.com/09622903-85de-4f2e-8e04-eff744b9cdc3, 0x2dc35800)
│   │   └──3.05 MB (00.66%) ++ worker(blob:https://www.facebook.com/09622903-85de-4f2e-8e04-eff744b9cdc3, 0x2dc39800)
│   └───4.00 MB (00.87%) ++ workers(chrome)
├────7.82 MB (01.70%) -- gfx
│    ├──6.67 MB (01.45%) ── heap-textures
│    └──1.15 MB (00.25%) -- (6 tiny)
│       ├──0.62 MB (00.14%) ── font-tables
│       ├──0.32 MB (00.07%) ── font-charmaps
│       ├──0.13 MB (00.03%) ── font-cache
│       ├──0.08 MB (00.02%) ── font-list
│       ├──0.00 MB (00.00%) ── font-shaped-words
│       └──0.00 MB (00.00%) ── user-fonts/cache-overhead
└────4.91 MB (01.06%) -- atom-tables
     ├──4.84 MB (01.05%) ── main
     └──0.06 MB (00.01%) ── static

Other Measurements

8,388,607.94 MB (100.0%) -- address-space
├──8,386,266.84 MB (99.97%) ── free(segments=539)
└──────2,341.10 MB (00.03%) ++ (2 tiny)

31.36 MB (100.0%) -- decommitted
├──28.86 MB (92.03%) ── js-non-window/gc-heap/decommitted-arenas
└───2.50 MB (07.97%) -- workers
    ├──1.54 MB (04.90%) -- workers(facebook.com)
    │  ├──0.51 MB (01.63%) ── worker(blob:https://www.facebook.com/09622903-85de-4f2e-8e04-eff744b9cdc3, 0x29abc800)/gc-heap/decommitted-arenas
    │  ├──0.51 MB (01.63%) ── worker(blob:https://www.facebook.com/09622903-85de-4f2e-8e04-eff744b9cdc3, 0x2dc35800)/gc-heap/decommitted-arenas
    │  └──0.51 MB (01.63%) ── worker(blob:https://www.facebook.com/09622903-85de-4f2e-8e04-eff744b9cdc3, 0x2dc39800)/gc-heap/decommitted-arenas
    └──0.96 MB (03.08%) -- workers(chrome)
       ├──0.50 MB (01.58%) ── worker(resource://gre/modules/PageThumbsWorker.js, 0x1e1a0000)/gc-heap/decommitted-arenas
       └──0.47 MB (01.49%) ── worker(resource://gre/modules/osfile/osfile_async_worker.js, 0x135cb000)/gc-heap/decommitted-arenas

4,507 (100.0%) -- event-counts
└──4,507 (100.0%) -- window-objects
   ├──3,165 (70.22%) -- top(https://www.facebook.com/anthony.carl.caudill/friends?lst=688745830%3A688745830%3A1557482689&source_ref=pb_friends_tl, id=427)/active
   │  ├──3,125 (69.34%) -- window(https://www.facebook.com/anthony.carl.caudill/friends?lst=688745830%3A688745830%3A1557482689&source_ref=pb_friends_tl)/dom
   │  │  ├──3,102 (68.83%) ── event-listeners
   │  │  └─────23 (00.51%) ── event-targets
   │  └─────40 (00.89%) ++ (8 tiny)
   ├──1,323 (29.35%) -- top(chrome://browser/content/browser.xul, id=3)/active
   │  ├──1,321 (29.31%) -- window(chrome://browser/content/browser.xul)/dom
   │  │  ├──1,311 (29.09%) ── event-listeners
   │  │  └─────10 (00.22%) ── event-targets
   │  └──────2 (00.04%) ── window(about:blank)/dom/event-targets [2]
   └─────19 (00.42%) ++ (2 tiny)

1 (100.0%) -- file-blob-urls
└──1 (100.0%) ── owner(https://www.facebook.com/)/blob:https://www.facebook.com/09622903-85de-4f2e-8e04-eff744b9cdc3

352.00 MB (100.0%) -- heap-committed
├──283.69 MB (80.59%) ── allocated
└───68.31 MB (19.41%) ── overhead

21.97 MB (100.0%) -- images
├──21.43 MB (97.55%) -- content
│  ├──21.35 MB (97.19%) -- raster
│  │  ├──21.35 MB (97.19%) -- used
│  │  │  ├──21.24 MB (96.65%) ── source
│  │  │  └───0.12 MB (00.54%) ── decoded-heap
│  │  └───0.00 MB (00.00%) ── unused/source
│  └───0.08 MB (00.36%) ── vector/used/source
├───0.54 MB (02.44%) -- chrome
│   ├──0.44 MB (01.99%) -- raster/used
│   │  ├──0.33 MB (01.50%) ── decoded-heap
│   │  └──0.11 MB (00.49%) ── source
│   └──0.10 MB (00.45%) ++ vector/used
└───0.00 MB (00.01%) ++ uncached/raster/used

178.59 MB (100.0%) -- js-main-runtime
├───77.32 MB (43.29%) -- compartments
│   ├──61.58 MB (34.48%) -- classes/objects
│   │  ├──50.41 MB (28.23%) ── gc-heap
│   │  └──11.17 MB (06.25%) -- malloc-heap
│   │     ├───9.26 MB (05.19%) ── slots
│   │     ├───1.90 MB (01.06%) ── elements/normal
│   │     └───0.01 MB (00.00%) ── misc
│   ├───7.40 MB (04.14%) -- scripts
│   │   ├──4.89 MB (02.74%) ── gc-heap
│   │   └──2.51 MB (01.40%) ── malloc-heap/data
│   ├───5.10 MB (02.85%) -- type-inference
│   │   ├──3.57 MB (02.00%) ── type-scripts
│   │   └──1.53 MB (00.86%) ++ (3 tiny)
│   └───3.24 MB (01.82%) ++ (11 tiny)
├───61.14 MB (34.23%) -- zones
│   ├──18.14 MB (10.16%) -- strings
│   │  ├──10.47 MB (05.86%) -- gc-heap
│   │  │  ├──10.30 MB (05.77%) ── latin1
│   │  │  └───0.18 MB (00.10%) ── two-byte
│   │  └───7.67 MB (04.30%) -- malloc-heap
│   │      ├──6.97 MB (03.90%) ── latin1
│   │      └──0.70 MB (00.39%) ── two-byte
│   ├──14.70 MB (08.23%) -- shapes
│   │  ├──13.04 MB (07.30%) -- gc-heap
│   │  │  ├───7.84 MB (04.39%) ── tree
│   │  │  ├───4.83 MB (02.70%) ── dict
│   │  │  └───0.37 MB (00.21%) ── base
│   │  └───1.65 MB (00.93%) ++ malloc-heap
│   ├───7.97 MB (04.46%) -- lazy-scripts
│   │   ├──6.09 MB (03.41%) ── gc-heap
│   │   └──1.88 MB (01.05%) ── malloc-heap
│   ├───7.81 MB (04.37%) ── type-pool
│   ├───4.34 MB (02.43%) ++ (7 tiny)
│   ├───4.16 MB (02.33%) -- object-groups
│   │   ├──4.00 MB (02.24%) ── gc-heap
│   │   └──0.16 MB (00.09%) ── malloc-heap
│   └───4.01 MB (02.25%) -- scopes
│       ├──2.58 MB (01.45%) ── malloc-heap
│       └──1.43 MB (00.80%) ── gc-heap
├───35.46 MB (19.85%) ── runtime
└────4.68 MB (02.62%) -- gc-heap
     ├──2.71 MB (01.52%) ++ (2 tiny)
     └──1.97 MB (01.10%) ── chunk-admin

224 (100.0%) -- js-main-runtime-compartments
├──202 (90.18%) -- system
│  ├──199 (88.84%) ++ (198 tiny)
│  └────3 (01.34%) ── [System Principal], about:blank [3]
└───22 (09.82%) ++ user

98.14 MB (100.0%) -- js-main-runtime-gc-heap-committed
├──93.85 MB (95.62%) -- used
│  ├──90.37 MB (92.08%) -- gc-things
│  │  ├──50.41 MB (51.36%) ── objects
│  │  ├──12.67 MB (12.91%) ── shapes
│  │  ├──10.47 MB (10.67%) ── strings
│  │  ├───6.09 MB (06.21%) ── lazy-scripts
│  │  ├───4.89 MB (04.98%) ── scripts
│  │  ├───4.00 MB (04.07%) ── object-groups
│  │  ├───1.43 MB (01.45%) ── scopes
│  │  └───0.41 MB (00.41%) ++ (3 tiny)
│  ├───1.97 MB (02.01%) ── chunk-admin
│  └───1.51 MB (01.54%) ── arena-admin
└───4.30 MB (04.38%) -- unused
    ├──1.71 MB (01.75%) ── arenas
    ├──1.58 MB (01.61%) ++ gc-things
    └──1.00 MB (01.02%) ── chunks

75 (100.0%) -- message-manager
└──75 (100.0%) -- referent
   ├──45 (60.00%) -- global-manager
   │  ├──45 (60.00%) ── strong
   │  └───0 (00.00%) ++ weak
   ├──16 (21.33%) -- parent-process-manager
   │  ├──16 (21.33%) ── strong
   │  └───0 (00.00%) ++ weak
   └──14 (18.67%) -- child-process-manager
      ├──11 (14.67%) -- weak
      │  ├──11 (14.67%) ── dead
      │  └───0 (00.00%) ── alive
      └───3 (04.00%) ── strong

773 (100.0%) -- observer-service
└──773 (100.0%) -- referent
   ├──594 (76.84%) ── strong
   └──179 (23.16%) -- weak
      ├──177 (22.90%) ── alive
      └────2 (00.26%) ── dead

254 (100.0%) -- observer-service-suspect
├──135 (53.15%) ── referent(topic=xpcom-shutdown)
└──119 (46.85%) ── referent(topic=memory-pressure)

1,167 (100.0%) -- preference-service
└──1,167 (100.0%) -- referent
   ├──1,020 (87.40%) ── strong
   └────147 (12.60%) -- weak
        ├──147 (12.60%) ── alive
        └────0 (00.00%) ── dead

100.89 MB (100.0%) -- window-objects
├───44.98 MB (44.58%) -- dom
│   ├──22.55 MB (22.35%) ── element-nodes
│   ├──18.89 MB (18.72%) ── orphan-nodes
│   ├───2.58 MB (02.56%) ── text-nodes
│   └───0.96 MB (00.95%) ++ (4 tiny)
├───35.47 MB (35.16%) -- layout
│   ├──12.35 MB (12.25%) ── frames
│   ├───8.59 MB (08.51%) ── style-sets
│   ├───3.40 MB (03.37%) ── pres-contexts
│   ├───2.99 MB (02.96%) ── line-boxes
│   ├───2.70 MB (02.68%) ── style-structs
│   ├───2.20 MB (02.18%) ── pres-shell
│   ├───1.85 MB (01.83%) ++ (2 tiny)
│   └───1.40 MB (01.38%) ── text-runs
├───20.05 MB (19.87%) ── style-sheets
└────0.39 MB (00.39%) ── property-tables

        1.76 MB ── d3d9-shared-textures
        0.00 MB ── gfx-d2d-vram-draw-target
        0.00 MB ── gfx-d2d-vram-source-surface
        8.39 MB ── gfx-surface-win32
        0.00 MB ── gfx-textures
        0.00 MB ── gfx-textures-peak
        0.00 MB ── gfx-tiles-waste
              0 ── ghost-windows
        0.00 MB ── gpu-committed
        0.00 MB ── gpu-dedicated
        0.00 MB ── gpu-shared
      283.69 MB ── heap-allocated
        1.00 MB ── heap-chunksize
      557.00 MB ── heap-mapped
              1 ── host-object-urls
        0.37 MB ── imagelib-surface-cache-estimated-locked
        0.37 MB ── imagelib-surface-cache-estimated-total
              0 ── imagelib-surface-cache-overflow-count
        2.02 MB ── js-main-runtime-temporary-peak
      594.65 MB ── private
      632.27 MB ── resident
      602.06 MB ── resident-unique
       10.29 MB ── system-heap-allocated
    2,324.30 MB ── vsize
7,863,701.94 MB ── vsize-max-contiguous
I'm not even going to bother posting the Firefox 66 usage... it's much worse, let's leave it at that. As for Palemoon, the images across the entire page account for about 55mb, tho I figure at least 10 megs could be shaved by using less caching.
moonchild wrote: If you want near-native execution speed with JavaScript, using a binary compiler for it is essential. That is not a theory. If you wish to put it to the test in practice, though, then I invite you to run Pale Moon in "interpreted" mode by disabling both the TraceMonkey and the IonMonkey engine (they are both parts of the JIT JavaScript compiler). In about:config, set javascript.options.baselinejit and javascript.options.ion to false (restart the browser after you change these options), and see where your performance goes on JS-heavy sites or with long-running programs. After that you can tell me if you still think it's "just sucking up resources".
I appreciate that it's more performant, however it's also true that for most of the sites we use it doesn't matter because almost all of the load time is attributable to http request waits for images anyway. If memory could be saved by perhaps making JIT-vs-interp a per-site selection, then it's probably worth it imo.
Last edited by tcaud on 2019-05-10, 10:47, edited 1 time in total.

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

Re: Memory use over the years: Mozilla

Unread post by Moonchild » 2019-05-10, 10:42

Did my reply even register with you? because it seems it didn't.

As for caching: that's just as much a performance mechanism as JIT compiling of JS. Sure you can save a few MB by disabling it, but you'll pay the price for 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

tcaud

Re: Memory use over the years: Mozilla

Unread post by tcaud » 2019-05-10, 10:55

Moonchild wrote:
2019-05-10, 10:42
Did my reply even register with you? because it seems it didn't.

As for caching: that's just as much a performance mechanism as JIT compiling of JS. Sure you can save a few MB by disabling it, but you'll pay the price for it.
It did, I just don't think that performance is as important for modern processors as it was in the P4 era. But even back then I remember using computers at the library and every page loading in a half second because fiber-optics. CPU burden wasn't a thing.

I went ahead and turned off IonMonkey as you suggested. The effects were dramatic. Following is my friends list again, fully loaded.

Code: Select all

367.06 MB (100.0%) -- explicit
├──127.76 MB (34.81%) -- window-objects
│  ├──120.52 MB (32.83%) -- top(https://www.facebook.com/anthony.carl.caudill/friends?lst=688745830%3A688745830%3A1557482689&source_ref=pb_friends_tl, id=15)
│  │  ├───98.11 MB (26.73%) -- active/window(https://www.facebook.com/anthony.carl.caudill/friends?lst=688745830%3A688745830%3A1557482689&source_ref=pb_friends_tl)
│  │  │   ├──32.62 MB (08.89%) -- js-compartment(https://www.facebook.com/anthony.carl.caudill/friends?lst=688745830%3A688745830%3A1557482689&source_ref=pb_friends_tl)
│  │  │   │  ├──28.96 MB (07.89%) -- classes
│  │  │   │  │  ├──11.06 MB (03.01%) -- class(Object)/objects
│  │  │   │  │  │  ├───7.93 MB (02.16%) ── gc-heap
│  │  │   │  │  │  └───3.13 MB (00.85%) ++ malloc-heap
│  │  │   │  │  ├───8.43 MB (02.30%) -- class(Function)/objects
│  │  │   │  │  │   ├──7.50 MB (02.04%) ── gc-heap
│  │  │   │  │  │   └──0.93 MB (00.25%) ── malloc-heap/slots
│  │  │   │  │  ├───5.19 MB (01.41%) -- class(Array)/objects
│  │  │   │  │  │   ├──4.82 MB (01.31%) ── gc-heap
│  │  │   │  │  │   └──0.37 MB (00.10%) ++ malloc-heap
│  │  │   │  │  └───4.29 MB (01.17%) ++ (11 tiny)
│  │  │   │  └───3.66 MB (01.00%) ++ (5 tiny)
│  │  │   ├──27.88 MB (07.60%) -- dom
│  │  │   │  ├──20.97 MB (05.71%) ── element-nodes
│  │  │   │  ├───4.55 MB (01.24%) ── orphan-nodes
│  │  │   │  └───2.35 MB (00.64%) ++ (4 tiny)
│  │  │   ├──24.87 MB (06.77%) -- layout
│  │  │   │  ├──10.13 MB (02.76%) -- frames
│  │  │   │  │  ├───5.53 MB (01.51%) ++ (8 tiny)
│  │  │   │  │  └───4.60 MB (01.25%) ── nsBlockFrame
│  │  │   │  ├──10.02 MB (02.73%) ++ (7 tiny)
│  │  │   │  └───4.72 MB (01.28%) ── style-sets
│  │  │   ├──12.18 MB (03.32%) ── style-sheets
│  │  │   └───0.56 MB (00.15%) ── property-tables
│  │  └───22.41 MB (06.10%) -- js-zone(0x182bc000)
│  │      ├──11.33 MB (03.09%) ++ (10 tiny)
│  │      ├───6.94 MB (01.89%) -- shapes
│  │      │   ├──4.72 MB (01.29%) ++ gc-heap
│  │      │   └──2.22 MB (00.60%) ++ malloc-heap
│  │      └───4.14 MB (01.13%) ── unused-gc-things
│  ├────6.47 MB (01.76%) -- top(chrome://browser/content/browser.xul, id=3)
│  │    ├──4.92 MB (01.34%) -- active
│  │    │  ├──4.78 MB (01.30%) ++ window(chrome://browser/content/browser.xul)
│  │    │  └──0.14 MB (00.04%) ++ window(about:blank)
│  │    └──1.55 MB (00.42%) ++ js-zone(0xebaf000)
│  └────0.77 MB (00.21%) ++ (3 tiny)
├───92.50 MB (25.20%) -- images
│   ├──92.07 MB (25.08%) -- content/raster
│   │  ├──91.99 MB (25.06%) ++ used
│   │  └───0.07 MB (00.02%) ++ unused
│   └───0.43 MB (00.12%) ++ chrome
├───48.40 MB (13.18%) -- js-non-window
│   ├──26.45 MB (07.21%) -- zones
│   │  ├──19.10 MB (05.20%) ++ zone(0x5d9d000)
│   │  ├───6.37 MB (01.74%) -- zone(0x5d6c000)
│   │  │   ├──5.49 MB (01.49%) -- strings
│   │  │   │  ├──5.46 MB (01.49%) -- string(<non-notable strings>)
│   │  │   │  │  ├──4.11 MB (01.12%) -- gc-heap
│   │  │   │  │  │  ├──4.10 MB (01.12%) ── latin1
│   │  │   │  │  │  └──0.01 MB (00.00%) ── two-byte
│   │  │   │  │  └──1.36 MB (00.37%) ++ malloc-heap
│   │  │   │  └──0.02 MB (00.01%) ++ string(length=11042, copies=1, "(?://.(com|/uD55C/uAD6D|/uC0BC/uC131|/uB2F7/uCEF4|/uB2F7/uB137|/u9999/u6E2F|/u9999/u683C/u91CC/u62C9|/u9910/u5385|/u98DF/u54C1|/u98DE/u5229/u6D66|/u96FB/u8A0A/u76C8/u79D1|/u96C6/u56E2|/u901A/u8CA9|/u8D2D/u7269|/u8C37/u6B4C|/u8BFA/u57FA/u4E9A|/u8054/u901A|/u7F51/u7EDC|/u7F51/u7AD9|/u7F51/u5E97|/u7F51/u5740|/u7EC4/u7EC7/u673A/u6784|/u79FB/u52A8|/u73E0/u5B9D|/u70B9/u770B|/u6FB3/u9580|/u6E38/u620F|/u6DE1/u9A6C/u9521|/u673A/u6784|/u66F8/u7C4D|/u65F6/u5C1A|/u65B0/u95FB|/u65B0/u52A0/u5761|/u653F/u5E9C|/u653F/u52A1|/u624B/u8868|/u624B/u673A|/u6211/u7231/u4F60|/u6148/u5584|/u5FAE/u535A|/u5E7F/u4E1C|/u5DE5/u884C|/u5BB6/u96FB|/u5A31/u4E50|/u5929/u4E3B/u6559|/u5927/u62FF|/u5927/u4F17/u6C7D/u8F66|/u5728/u7EBF|/u5609/u91CC/u5927/u9152/u5E97|/u5609/u91CC|/u5546/u6807|/u5546/u5E97|/u5546/u57CE|/u53F0/u7063|/u53F0/u6E7E|/u516C/u76CA|/u516C/u53F8|/u516B/u5366|/u5065/u5EB7|/u4FE1/u606F|/u4F5B/u5C71|/u4F01/u4E1A|/u4E2D/u6587/u7F51|/u4E2D/u570B|/u4E2D/u56FD|/u4E2D/u4FE1|/u4E16/u754C|/u30DD/u30A4/u30F3/u30C8|/u30D5/u30A1/u30C3/u3" (truncated))
│   │  │   └──0.88 MB (00.24%) ++ (5 tiny)
│   │  └───0.98 MB (00.27%) ++ (4 tiny)
│   ├──19.94 MB (05.43%) -- runtime
│   │  ├───8.50 MB (02.32%) ── script-data
│   │  ├───4.76 MB (01.30%) ── shared-immutable-strings-cache
│   │  ├───4.10 MB (01.12%) ── atoms-table
│   │  └───2.57 MB (00.70%) ++ (10 tiny)
│   └───2.00 MB (00.54%) ++ gc-heap
├───37.33 MB (10.17%) -- heap-overhead
│   ├──17.14 MB (04.67%) ── bin-unused
│   ├──15.66 MB (04.27%) ── page-cache
│   └───4.54 MB (01.24%) ── bookkeeping
├───32.44 MB (08.84%) ── heap-unclassified
├───12.33 MB (03.36%) ++ (17 tiny)
├────7.72 MB (02.10%) -- gfx
│    ├──6.32 MB (01.72%) ── heap-textures
│    └──1.40 MB (00.38%) ++ (6 tiny)
├────4.59 MB (01.25%) ++ storage/sqlite
└────4.00 MB (01.09%) ++ workers/workers(chrome)

Other Measurements

8,388,607.94 MB (100.0%) -- address-space
├──8,386,704.31 MB (99.98%) ── free(segments=332)
└──────1,903.63 MB (00.02%) ++ (2 tiny)

3.37 MB (100.0%) -- decommitted
├──2.40 MB (71.23%) ── js-non-window/gc-heap/decommitted-arenas
└──0.97 MB (28.77%) -- workers/workers(chrome)
   ├──0.50 MB (14.85%) ── worker(resource://gre/modules/PageThumbsWorker.js, 0x1d23e800)/gc-heap/decommitted-arenas
   └──0.47 MB (13.92%) ── worker(resource://gre/modules/osfile/osfile_async_worker.js, 0x129e3800)/gc-heap/decommitted-arenas

3,871 (100.0%) -- event-counts
└──3,871 (100.0%) -- window-objects
   ├──2,649 (68.43%) -- top(https://www.facebook.com/anthony.carl.caudill/friends?lst=688745830%3A688745830%3A1557482689&source_ref=pb_friends_tl, id=15)/active/window(https://www.facebook.com/anthony.carl.caudill/friends?lst=688745830%3A688745830%3A1557482689&source_ref=pb_friends_tl)/dom
   │  ├──2,637 (68.12%) ── event-listeners
   │  └─────12 (00.31%) ── event-targets
   ├──1,202 (31.05%) -- top(chrome://browser/content/browser.xul, id=3)/active
   │  ├──1,200 (31.00%) -- window(chrome://browser/content/browser.xul)/dom
   │  │  ├──1,197 (30.92%) ── event-listeners
   │  │  └──────3 (00.08%) ── event-targets
   │  └──────2 (00.05%) ── window(about:blank)/dom/event-targets [2]
   └─────20 (00.52%) ++ (3 tiny)

298.12 MB (100.0%) -- heap-committed
├──260.79 MB (87.48%) ── allocated
└───37.33 MB (12.52%) ── overhead

92.50 MB (100.0%) -- images
├──92.07 MB (99.54%) -- content/raster
│  ├──91.99 MB (99.46%) -- used
│  │  ├──72.84 MB (78.75%) ── decoded-heap
│  │  └──19.15 MB (20.70%) ── source
│  └───0.07 MB (00.08%) ++ unused
└───0.43 MB (00.46%) ++ chrome

107.36 MB (100.0%) -- js-main-runtime
├───46.19 MB (43.02%) -- compartments
│   ├──36.03 MB (33.56%) -- classes/objects
│   │  ├──29.89 MB (27.84%) ── gc-heap
│   │  └───6.14 MB (05.72%) -- malloc-heap
│   │      ├──5.09 MB (04.74%) ── slots
│   │      └──1.05 MB (00.98%) ++ (2 tiny)
│   ├───5.12 MB (04.77%) -- scripts
│   │   ├──3.43 MB (03.19%) ── gc-heap
│   │   └──1.69 MB (01.58%) ── malloc-heap/data
│   ├───2.65 MB (02.47%) ++ (10 tiny)
│   └───2.38 MB (02.22%) -- type-inference
│       ├──1.56 MB (01.45%) ── type-scripts
│       └──0.83 MB (00.77%) ++ (3 tiny)
├───39.23 MB (36.54%) -- zones
│   ├───9.90 MB (09.22%) -- shapes
│   │   ├──6.84 MB (06.37%) -- gc-heap
│   │   │  ├──4.11 MB (03.83%) ── tree
│   │   │  ├──2.57 MB (02.39%) ── dict
│   │   │  └──0.16 MB (00.15%) ── base
│   │   └──3.06 MB (02.85%) -- malloc-heap
│   │      ├──1.72 MB (01.60%) ── tree-tables
│   │      └──1.34 MB (01.25%) ++ (2 tiny)
│   ├───8.30 MB (07.73%) -- strings
│   │   ├──5.70 MB (05.30%) -- gc-heap
│   │   │  ├──5.56 MB (05.18%) ── latin1
│   │   │  └──0.13 MB (00.12%) ── two-byte
│   │   └──2.61 MB (02.43%) -- malloc-heap
│   │      ├──2.49 MB (02.32%) ── latin1
│   │      └──0.11 MB (00.10%) ── two-byte
│   ├───7.70 MB (07.17%) ── unused-gc-things
│   ├───3.49 MB (03.25%) -- lazy-scripts
│   │   ├──2.66 MB (02.48%) ── gc-heap
│   │   └──0.82 MB (00.77%) ── malloc-heap
│   ├───2.89 MB (02.69%) ── type-pool
│   ├───2.80 MB (02.61%) -- scopes
│   │   ├──1.72 MB (01.60%) ── malloc-heap
│   │   └──1.09 MB (01.01%) ── gc-heap
│   ├───2.36 MB (02.20%) -- object-groups
│   │   ├──2.29 MB (02.13%) ── gc-heap
│   │   └──0.08 MB (00.07%) ── malloc-heap
│   └───1.79 MB (01.67%) ++ (6 tiny)
├───19.94 MB (18.58%) ── runtime
└────2.00 MB (01.86%) ++ gc-heap

182 (100.0%) -- js-main-runtime-compartments
├──174 (95.60%) -- system
│  ├──168 (92.31%) ++ (168 tiny)
│  ├────3 (01.65%) ── [System Principal], about:blank [3]
│  └────3 (01.65%) ── [System Principal], inProcessTabChildGlobal?ownedBy=chrome://browser/content/browser.xul [3]
└────8 (04.40%) ++ user

62.60 MB (100.0%) -- js-main-runtime-gc-heap-committed
├──53.90 MB (86.11%) -- used
│  ├──51.93 MB (82.95%) -- gc-things
│  │  ├──29.89 MB (47.75%) ── objects
│  │  ├───6.68 MB (10.67%) ── shapes
│  │  ├───5.70 MB (09.10%) ── strings
│  │  ├───3.43 MB (05.48%) ── scripts
│  │  ├───2.66 MB (04.26%) ── lazy-scripts
│  │  ├───2.29 MB (03.65%) ── object-groups
│  │  ├───1.09 MB (01.73%) ── scopes
│  │  └───0.19 MB (00.31%) ++ (3 tiny)
│  ├───1.00 MB (01.60%) ── chunk-admin
│  └───0.98 MB (01.56%) ── arena-admin
└───8.70 MB (13.89%) -- unused
    ├──7.70 MB (12.30%) -- gc-things
    │  ├──3.44 MB (05.49%) ── objects
    │  ├──2.01 MB (03.20%) ── strings
    │  ├──1.25 MB (01.99%) ++ (7 tiny)
    │  └──1.00 MB (01.60%) ── shapes
    ├──1.00 MB (01.60%) ── chunks
    └──0.00 MB (00.00%) ── arenas

65 (100.0%) -- message-manager
└──65 (100.0%) -- referent
   ├──45 (69.23%) -- global-manager
   │  ├──45 (69.23%) ── strong
   │  └───0 (00.00%) ++ weak
   ├──16 (24.62%) -- parent-process-manager
   │  ├──16 (24.62%) ── strong
   │  └───0 (00.00%) ++ weak
   └───4 (06.15%) -- child-process-manager
       ├──3 (04.62%) ── strong
       └──1 (01.54%) -- weak
          ├──1 (01.54%) ── dead
          └──0 (00.00%) ── alive

603 (100.0%) -- observer-service
└──603 (100.0%) -- referent
   ├──440 (72.97%) ── strong
   └──163 (27.03%) -- weak
      ├──163 (27.03%) ── alive
      └────0 (00.00%) ── dead

107 (100.0%) -- observer-service-suspect
└──107 (100.0%) ── referent(topic=xpcom-shutdown)

1,134 (100.0%) -- preference-service
└──1,134 (100.0%) -- referent
   ├────990 (87.30%) ── strong
   └────144 (12.70%) -- weak
        ├──144 (12.70%) ── alive
        └────0 (00.00%) ── dead

68.80 MB (100.0%) -- window-objects
├──28.60 MB (41.57%) -- dom
│  ├──21.47 MB (31.20%) ── element-nodes
│  ├───4.57 MB (06.64%) ── orphan-nodes
│  ├───1.68 MB (02.44%) ── text-nodes
│  ├───0.88 MB (01.28%) ── other
│  └───0.00 MB (00.00%) ++ (3 tiny)
├──26.50 MB (38.53%) -- layout
│  ├──10.26 MB (14.91%) ── frames
│  ├───5.28 MB (07.68%) ── style-sets
│  ├───3.52 MB (05.12%) ── pres-contexts
│  ├───2.90 MB (04.22%) ── line-boxes
│  ├───1.40 MB (02.03%) ── text-runs
│  ├───1.35 MB (01.97%) ── style-structs
│  ├───0.93 MB (01.36%) ++ (2 tiny)
│  └───0.85 MB (01.24%) ── pres-shell
├──13.13 MB (19.08%) ── style-sheets
└───0.57 MB (00.82%) ── property-tables

        0.00 MB ── gfx-d2d-vram-draw-target
        0.00 MB ── gfx-d2d-vram-source-surface
        6.90 MB ── gfx-surface-win32
        0.00 MB ── gfx-textures
        0.00 MB ── gfx-textures-peak
        0.00 MB ── gfx-tiles-waste
              0 ── ghost-windows
        0.00 MB ── gpu-committed
        0.00 MB ── gpu-dedicated
        0.00 MB ── gpu-shared
      260.79 MB ── heap-allocated
        1.00 MB ── heap-chunksize
      364.00 MB ── heap-mapped
        0.18 MB ── imagelib-surface-cache-estimated-locked
       69.95 MB ── imagelib-surface-cache-estimated-total
              0 ── imagelib-surface-cache-overflow-count
        1.72 MB ── js-main-runtime-temporary-peak
      436.29 MB ── private
      460.28 MB ── resident
      443.75 MB ── resident-unique
        4.04 MB ── system-heap-allocated
    1,886.97 MB ── vsize
6,704,298.19 MB ── vsize-max-contiguous
And AJAX responsiveness/page loading was about 50% better.

Edit: turned the whole JIT off and tried again. Facebook didn't load any slower... in fact it was faster than with Ion active (probably because it wasn't slinging RAM around). RAM down to 300mb for the whole list. Remarkably images used less memory with JIT off.

I think I'm going to leave it off.

I don't think Javascript size is a problem at all. I think the problem is how browsers are reacting to JS itself. I think Mozilla has engineered its compiler to use time waiting for http requested items (page loading period) to budget RAM in case a graphics intensive app (or a tracker...) should want it, but they are doing this for every page. Paradoxically, this results in slower browsing.

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

Re: Memory use over the years: Mozilla

Unread post by Moonchild » 2019-05-10, 12:28

Well, for your sake I hope you won't run across a blog that uses frameworks -- it will be slow as tar. Just don't be surprised if some sites become really slow with your settings to "off".

Your browser, Your way, though! Enjoy a lighter but slower web :)
"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
Moonraker
Board Warrior
Board Warrior
Posts: 1878
Joined: 2015-09-30, 23:02
Location: uk.

Re: Memory use over the years: Mozilla

Unread post by Moonraker » 2019-05-10, 12:47

Bloat and multi-process browsing is a contributing factor in the high memory use and of course if we look at technical aspect of modern computing with huge ram available as standard,mozilla is slurping up this extra physical ram for the benefit of it's browser.

Give them an inch and they will take a mile.
user of multiple puppy linuxes..upup,fossapup.scpup,xenialpup..... :thumbup:

Pale moon 29.4.1

tcaud

Re: Memory use over the years: Mozilla

Unread post by tcaud » 2019-05-10, 13:54

The problem with exploiting RAM/cache to improve performance is it only goes so far. Sooner or later you're throwing around RAM constantly and jamming your bus, causing latency.

I went a little farther with javascript.options at about:config and cut the max memory JS can use to 75 mb. Apparently the compiler takes that max and budgets itself across different forms of JS memory accordingly. I realize some webapps could chafe at such a low setting and if only I had an add-on or something that would allow me to set this max per page. However I'm probably just going to rely on vanilla Firefox for anything special I need (games are the only thing I can think of) and use this tweaked Palemoon install for my reading. Doing great on the memory now... 9 tabs open and only 300mb used (without adblocking even).

User avatar
badnick
Astronaut
Astronaut
Posts: 670
Joined: 2017-03-23, 19:56

Re: Memory use over the years: Mozilla

Unread post by badnick » 2019-05-11, 16:37

I can show tens of pages wich works great on -Firefox 17 !!! , I am shure most of them are heavy JS. From what I know Firefox 17 is the latest version before IonMonkey was implemented. All the pages are loaded at the at least same speed like "modern browsers", but some of the links even visible faster.
Windows 10 pro /64 (version 1809)
PM last/64

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

Re: Memory use over the years: Mozilla

Unread post by Moonchild » 2019-05-11, 16:53

badnick wrote:
2019-05-11, 16:37
I can show tens of pages wich works great on -Firefox 17 !!! , I am shure most of them are heavy JS.
Firefox 17 still uses baseline JIT compilation; IonMonkey is just the next layer on top of that. Also, using that old of a browser will not activate much of the JS because it's not supporting modern JS features (meaning it will likely be broken, as well)
"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

Locked