[SFOS Browser] Solving the browser memory issue

I am.    

1 Like

Strange.

My setup is bog standard with no tweaks of any kind as far as I remember.

Hostfile blocks can make plenty of difference. Try turning it off and see if it alters behaviour

That didn’t make any difference. That site doesn’t seem to have very many ads.

I have changed Browser to ANGELFISH …all OK!!!

I charged up my old XperiaX with 4.4.x on it, and it loaded OK, but much slower, obviously. This is pretty strange.

Update: It worked yesterday on the 10iii after the headline changed. Hmmm, very strange

So, same benchmark as before:

  • Xperia 10II, build 4.5.0.19
  • Using the 4G to access internet (in case that has some influence).
  • Browser has 0 active tabs.
  • Browser is still default config, no change in the about:config.
  • Browsing: Visual Studio Code March 2023

First test was following @Seven.of.nine tip on another thread:

The scenario:

  • I opened DeadBeef Silica
  • Played one song for a few seconds
  • Opened the browser

Spoiler alert, did not work. The browser crashed with the music app with it:

Mai 15 20:19:37 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'deadbeef-main' (27362), adj 100,
                                              to free 69368kB on behalf of 'VideoDecMsgThre' (28661) because
                                              cache 560400kB is below limit 560800kB for oom_score_adj 58
                                              Free memory is 309744kB above reserved.
                                              Free CMA is 16016kB
                                              Total reserve is 18680kB
                                              Total free pages is 28216kB
                                              Total file cache is 605596kB
                                              Slab Reclaimable is 116408kB
                                              Slab UnReclaimable is 452048kB
                                              Total Slab is 568456kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 376kB
                                              Free Swap 316520kB
                                              queue len is 1 of max 1 reason:0x2 margin:-1788
Mai 15 20:19:37 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'id.ext.services' (25665), adj 100,
                                              to free 55600kB on behalf of 'HwBinder:3134_4' (6053) because
                                              cache 559432kB is below limit 560800kB for oom_score_adj 58
                                              Free memory is 311768kB above reserved.
                                              Free CMA is 23744kB
                                              Total reserve is 18680kB
                                              Total free pages is 37372kB
                                              Total file cache is 605008kB
                                              Slab Reclaimable is 116208kB
                                              Slab UnReclaimable is 452048kB
                                              Total Slab is 568256kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 376kB
                                              Free Swap 316444kB
                                              queue len is 1 of max 1 reason:0x2 margin:-1263
Mai 15 20:19:37 Xperia10II-DualSIM kernel: oom_reaper: reaped process 27362 (deadbeef-main), now anon-rss:0kB, file-rss:268kB, shmem-rss:272kB
Mai 15 20:19:37 Xperia10II-DualSIM kernel: oom_reaper: reaped process 25665 (id.ext.services), now anon-rss:0kB, file-rss:0kB, shmem-rss:112kB
Mai 15 20:19:38 Xperia10II-DualSIM booster-generic[5952]: *** signal=17 pid=5952
Mai 15 20:19:38 Xperia10II-DualSIM /usr/libexec/mapplauncherd/booster-generic[5952]: warning: boosted process (pid=27362) signal(Killed)
Mai 15 20:19:38 Xperia10II-DualSIM /usr/libexec/mapplauncherd/booster-generic[5952]: warning: Daemon: sending exit(1) to invoker(28411)
Mai 15 20:19:38 Xperia10II-DualSIM invoker[28411]: warning: application (pid=-1) exit(1) signal(0)
Mai 15 20:19:38 Xperia10II-DualSIM kernel: BUG: Bad rss-counter state mm:ffffffc0c061b800 idx:4 val:3054
Mai 15 20:19:38 Xperia10II-DualSIM lipstick[6159]: [D] onDestruction:268 - coverActionIndicators destroyed deadbeef-silica.desktop
Mai 15 20:19:38 Xperia10II-DualSIM dbus-daemon[1725]: [system] Rejected send message, 2 matched rules; type="error", sender=":1.61" (uid=100000 pid=6159 comm="/usr/bin/lipstick -plugin evdevtouch -plugin evdev" label="u:r:kernel:s0") interface="(unset)" member="(unset)" error name="org.freedesktop.DBus.Error.UnknownMethod" requested_reply="0" destination=":1.3" (uid=0 pid=2668 comm="/usr/sbin/ohmd --no-daemon --mlock=none" label="u:r:kernel:s0")
Mai 15 20:19:38 Xperia10II-DualSIM dbus-daemon[1725]: dbus-daemon[1725]: [system] Rejected send message, 2 matched rules; type="error", sender=":1.61" (uid=100000 pid=6159 comm="/usr/bin/lipstick -plugin evdevtouch -plugin evdev" label="u:r:kernel:s0") interface="(unset)" member="(unset)" error name="org.freedesktop.DBus.Error.UnknownMethod" requested_reply="0" destination=":1.3" (uid=0 pid=2668 comm="/usr/sbin/ohmd --no-daemon --mlock=none" label="u:r:kernel:s0")
Mai 15 20:19:38 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'sailfish-browse' (25220), adj 0,
                                              to free 377880kB on behalf of 'HwBinder:3134_4' (6053) because
                                              cache 468620kB is below limit 468640kB for oom_score_adj 0
                                              Free memory is 315268kB above reserved.
                                              Free CMA is 32312kB
                                              Total reserve is 18680kB
                                              Total free pages is 54304kB
                                              Total file cache is 512572kB
                                              Slab Reclaimable is 111104kB
                                              Slab UnReclaimable is 453372kB
                                              Total Slab is 564476kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 1358kB
                                              Free Swap 311852kB
                                              queue len is 1 of max 1 reason:0x2 margin:492
Mai 15 20:19:38 Xperia10II-DualSIM kernel: binder: 25220:28691 ioctl c0306201 70ed3e94a0 returned -14
Mai 15 20:19:38 Xperia10II-DualSIM kernel: oom_reaper: reaped process 25220 (sailfish-browse), now anon-rss:0kB, file-rss:77288kB, shmem-rss:340kB

And i also tried this, first one option at the time, then all three together, all options lead to browser crash:

apz.autoscroll.enabled: off

Mai 15 20:33:03 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'maliit-server' (23533), adj 0,
                                              to free 84468kB on behalf of 'kworker/u16:1' (30350) because
                                              cache 463536kB is below limit 468640kB for oom_score_adj 0
                                              Free memory is 291880kB above reserved.
                                              Free CMA is 13200kB
                                              Total reserve is 18680kB
                                              Total free pages is 25076kB
                                              Total file cache is 512872kB
                                              Slab Reclaimable is 113688kB
                                              Slab UnReclaimable is 452912kB
                                              Total Slab is 566600kB
                                              GFP mask is 0x14142c0
                                              Indirect Reclaimable is 2401kB
                                              Free Swap 295540kB
                                              queue len is 1 of max 1 reason:0x2 margin:-1515
Mai 15 20:33:03 Xperia10II-DualSIM gecko-camera[30368]: droid-codec configureOutput:766 -- Configuring converter for stride:1920 slice-height: 1080 top: 0 left:0 width: 1920 height: 1080 format: 2141391876
Mai 15 20:33:03 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'sailfish-browse' (30368), adj 0,
                                              to free 431896kB on behalf of 'VideoDecMsgThre' (895) because
                                              cache 458196kB is below limit 468640kB for oom_score_adj 0
                                              Free memory is 327644kB above reserved.
                                              Free CMA is 17944kB
                                              Total reserve is 18680kB
                                              Total free pages is 68248kB
                                              Total file cache is 508020kB
                                              Slab Reclaimable is 113688kB
                                              Slab UnReclaimable is 453708kB
                                              Total Slab is 567396kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 2401kB
                                              Free Swap 295372kB
                                              queue len is 1 of max 1 reason:0x2 margin:7464
Mai 15 20:33:03 Xperia10II-DualSIM kernel: oom_reaper: reaped process 23533 (maliit-server), now anon-rss:0kB, file-rss:2472kB, shmem-rss:128kB

apz.disable_for_scroll_linked_effects: on

Mai 15 20:35:03 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'maliit-server' (32343), adj 0,
                                              to free 87248kB on behalf of 'VideoDecMsgThre' (2090) because
                                              cache 465828kB is below limit 468640kB for oom_score_adj 0
                                              Free memory is 303036kB above reserved.
                                              Free CMA is 264kB
                                              Total reserve is 18680kB
                                              Total free pages is 16932kB
                                              Total file cache is 516488kB
                                              Slab Reclaimable is 108232kB
                                              Slab UnReclaimable is 452516kB
                                              Total Slab is 560748kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 2410kB
                                              Free Swap 302764kB
                                              queue len is 1 of max 1 reason:0x2 margin:-534
Mai 15 20:35:03 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'sailfish-browse' (1025), adj 0,
                                              to free 454168kB on behalf of 'HwBinder:2736_3' (1436) because
                                              cache 465436kB is below limit 468640kB for oom_score_adj 0
                                              Free memory is 323988kB above reserved.
                                              Free CMA is 10220kB
                                              Total reserve is 18680kB
                                              Total free pages is 50356kB
                                              Total file cache is 516292kB
                                              Slab Reclaimable is 108192kB
                                              Slab UnReclaimable is 452516kB
                                              Total Slab is 560708kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 2410kB
                                              Free Swap 302720kB
                                              queue len is 1 of max 1 reason:0x2 margin:4714
                                              
browser.cache.disk.max_entry_size: 4096 → 1024                                  
                                              
Mai 15 20:38:26 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'maliit-server' (952), adj 0,
                                              to free 83604kB on behalf of 'Compositor' (2959) because
                                              cache 466248kB is below limit 468640kB for oom_score_adj 0
                                              Free memory is 269760kB above reserved.
                                              Free CMA is 4844kB
                                              Total reserve is 18680kB
                                              Total free pages is 20608kB
                                              Total file cache is 517916kB
                                              Slab Reclaimable is 111888kB
                                              Slab UnReclaimable is 453220kB
                                              Total Slab is 565108kB
                                              GFP mask is 0x14000c2
                                              Indirect Reclaimable is 409kB
                                              Free Swap 272264kB
                                              queue len is 1 of max 1 reason:0x2 margin:-729
Mai 15 20:38:26 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'sailfish-browse' (2363), adj 0,
                                              to free 433472kB on behalf of 'VideoDecMsgThre' (3703) because
                                              cache 463056kB is below limit 468640kB for oom_score_adj 0
                                              Free memory is 277684kB above reserved.
                                              Free CMA is 4720kB
                                              Total reserve is 18680kB
                                              Total free pages is 30768kB
                                              Total file cache is 514708kB
                                              Slab Reclaimable is 111884kB
                                              Slab UnReclaimable is 453096kB
                                              Total Slab is 564980kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 409kB
                                              Free Swap 272180kB
                                              queue len is 1 of max 1 reason:0x2 margin:1262
Mai 15 20:38:26 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'invoker' (2912), adj 0,
                                              to free 2528kB on behalf of 'HwBinder:3134_4' (6053) because
                                              cache 460904kB is below limit 468640kB for oom_score_adj 0
                                              Free memory is 282780kB above reserved.
                                              Free CMA is 5392kB
                                              Total reserve is 18680kB
                                              Total free pages is 34480kB
                                              Total file cache is 512748kB
                                              Slab Reclaimable is 111884kB
                                              Slab UnReclaimable is 452896kB
                                              Total Slab is 564780kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 409kB
                                              Free Swap 272176kB
                                              queue len is 1 of max 1 reason:0x2 margin:2549

Memory performance during the last test :

Memory at 2023-05-15T20:38:22.701
Memory details: 3.5 GiB total, 25.7 MiB free, 110.7 MiB buffers, 940.6 MiB cached (including 19.6 MiB shmem (tmpfs)), 0 B swap cache
Kernel:         565.4 MiB SLAB (123.0 MiB reclaimable), 
               ~ 1.2 GiB other kernel memory? It means: total - anonymous process - slab - free - buffers - cached - swap cache
Swap:           1024.0 MiB total, 295.0 MiB free (29%)
Available:      1.1 GiB (33%) estimated by kernel
               1.2 GiB (33%) computed. It means: free + buffers + (cached - Shmem) + swap cache + slab reclaimable

Processes memory (smaps Pss):

   PID process                                                 size (% of total)  [oom_adj, oom_score, oom_score_adj]
  2363 booster [browse                                    362.9 MiB (10%)
  2913 booster [browse                                     18.9 MiB (1%)  [-1000, 0, 0]
 22299 memory-record                                       16.4 MiB (0%)  [-1000, 0, 0]
  7451 tracker-miner-f                                     11.2 MiB (0%)  [-750, 0, 0]
  3571 tracker-extract                                      8.1 MiB (0%)  [-750, 0, 0]

All three together

Mai 15 20:42:35 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'id.ext.services' (3744), adj 100,
                                              to free 41588kB on behalf of 'HwBinder:2736_1' (2800) because
                                              cache 558380kB is below limit 560800kB for oom_score_adj 58
                                              Free memory is 277836kB above reserved.
                                              Free CMA is 16644kB
                                              Total reserve is 18680kB
                                              Total free pages is 33824kB
                                              Total file cache is 608892kB
                                              Slab Reclaimable is 121976kB
                                              Slab UnReclaimable is 453432kB
                                              Total Slab is 575408kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 2503kB
                                              Free Swap 278120kB
                                              queue len is 1 of max 1 reason:0x2 margin:-711
Mai 15 20:42:36 Xperia10II-DualSIM kernel: oom_reaper: reaped process 3744 (id.ext.services), now anon-rss:0kB, file-rss:0kB, shmem-rss:112kB
Mai 15 20:42:36 Xperia10II-DualSIM kernel: lowmemorykiller: Killing 'sailfish-browse' (4129), adj 0,
                                              to free 430012kB on behalf of 'HwBinder:3134_1' (10897) because
                                              cache 465764kB is below limit 468640kB for oom_score_adj 0
                                              Free memory is 268820kB above reserved.
                                              Free CMA is 17216kB
                                              Total reserve is 18680kB
                                              Total free pages is 29908kB
                                              Total file cache is 517040kB
                                              Slab Reclaimable is 116540kB
                                              Slab UnReclaimable is 454348kB
                                              Total Slab is 570888kB
                                              GFP mask is 0x14280c2
                                              Indirect Reclaimable is 1180kB
                                              Free Swap 272884kB
                                              queue len is 1 of max 1 reason:0x2 margin:-1311

Memory performance during this test

Memory at 2023-05-15T20:42:34.706
Memory details: 3.5 GiB total, 23.3 MiB free, 86.6 MiB buffers, 645.8 MiB cached (including 10.2 MiB shmem (tmpfs)), 0 B swap cache
Kernel:         563.5 MiB SLAB (120.4 MiB reclaimable), 
                ~ 1.6 GiB other kernel memory? It means: total - anonymous process - slab - free - buffers - cached - swap cache
Swap:           1024.0 MiB total, 280.0 MiB free (27%)
Available:      850.5 MiB (24%) estimated by kernel
                866.0 MiB (24%) computed. It means: free + buffers + (cached - Shmem) + swap cache + slab reclaimable

Processes memory (smaps Pss):

    PID process                                                 size (% of total)  [oom_adj, oom_score, oom_score_adj]
   4129 booster-browser                                    405.2 MiB (11%)
   4981 booster-browser                                     19.8 MiB (1%)  [-1000, 0, 0]
  22299 memory-record                                       16.6 MiB (0%)  [-1000, 0, 0]
   7451 tracker-miner-f                                     10.1 MiB (0%)  [-750, 0, 0]
   5263 tracker-extract                                      8.7 MiB (0%)  [-750, 0, 0]
   6035 xt9-server                                           6.4 MiB (0%)  [-750, 0, 0]
   6293 pulseaudio                                           5.5 MiB (0%)  [-750, 0, 0]
   5902 systemd                                              2.4 MiB (0%)  [-750, 0, 0]
   6408 dconf-service                                        1.8 MiB (0%)  [-750, 0, 0]
   5957 dbus-daemon                                          1.7 MiB (0%)  [-750, 0, 0]
   6041 ngfd                                                 1.4 MiB (0%)  [-750, 0, 0]
   6687 0                                                  858.0 KiB (0%)  [-1000, 0, 0]
  19302 alienkeyboardse                                    824.0 KiB (0%)  [-750, 0, 0]
  19278 alienaudioservi                                    684.0 KiB (0%)  [-750, 0, 0]


I hope this can enlighten some of you on ideas/tools to try next, either to measure the memory or the browser or hacking into understanding it.

4 Likes

Yesterday I had a hanging browser without full crash but an error message regarding booster-browser - wait or abort. I did nothing to not confuse the phone and only waited, and luckily the browser continued after abt. 5 seconds.

most crashes or at least massive delays occur on this SFOS Forum site, fewer on news.orf.at , surprisingly Youtube never crashes.

Strange, why is booster-browser listed twice with different PIDs?

that’s above my knowledge

My too, but looks strange. Right now I had my first crash on sending a SMS. So maybe the underlying problem is really not the browser itself but more the process management in base system. There I can also say nothing to it, imy knowledge is much too less.

Maybe this is a kind of a bad joke/trolling:

Strange, why is booster-browser listed twice with different PIDs?

To boost it twice as fast! :rofl:

3 Likes

Booster browser is a systemd template service (booster-browser@.service).

There are at least two services derived from that template, one for the browser and one for the email apps. (In theory any app which uses WebView could have its own booster this way.)

Each has their own booster process, the same binary with different configurations applied.

3 Likes

Profiling

Has anyone in this thread poked around about:memory screen? Anything noteworthy?

1 Like

Yes, now. Because of your information that this exists.
I clicked ‘Free memory - Minimize…’, then enabled ‘Show memory reports - verbose’ and clicked ‘Measure’.
A strange output is this (maybe of interest):
Warning: the ‘heap-allocated’ memory reporter does not work for this platform and/or configuration. This means that ‘heap-unclassified’ is not shown and the ‘explicit’ tree shows less memory than it should.

I honor this efforts to get a more stable browsing-experience but i fear the solutions will only last until next update of the used Browser-Engine in native SailfishOS-Browser.

1 Like

So we’ll have plenty of time! :wink:

1 Like

What make you sure, did there exist some kind of a Roadmap for the Updates?

Roadmap? Nothing is sure. Ask Jolla for roadmap and tell me!
edit: I extrapolated the Browser update intervals from 2019 until today.

1 Like

They are waiting for something to be stable enough to release a new update, I don’t remember what but I’ve heard from Jolla something

1 Like