Elektrine lite

โ† Feed

@gabrielesvelto@fosstodon.org

Post #933200

2022-11-22 14:32 UTC

My blog post describing how we cut #Firefox out-of-memory crashes by more than 70% with one weird trick is out: https://hacks.mozilla.org/2022/11/improving-firefox-stability-with-this-one-weird-trick/ The title is not click-bait, I swear, it *is* one weird trick.

Replies (16)

  • I've read lots of interesting discussion about my blog post on forums, social media and comment sections. Both regarding the contents and the title, but this particular comment beats all the other ones:

    Open ##1736076

  • Google developers have noticed my blog post and are trying to retry failed allocations in #Chrome too: https://chromium-review.googlesource.com/c/chromium/src/+/4051183 The code is pretty much the same as ours but they check for two more failures: ERROR_COMMITMENT_MINIMUM and ERROR_PAGEFILE_QUOTA. I'm confident those are not needed because they appear in Microsoft documentation but never showed up in Firefox crash data. As they say: do as Microsoft does not as Microsoft says.

    Open ##1736077

  • @guenther@chaos.social 2022-11-22 15:17

    @gabrielesvelto Jesus Christ. I guess it's called Mozilla "Hacks" for a reason :D

    Open ##1736078

  • @robryk@qoto.org 2022-11-22 15:23

    @gabrielesvelto How does this relate to unload-tabs-on-memory-pressure mechanism? (I would naively expect that to always run out of unloadable tabs first; is that the case?)

    Open ##1736079

  • @wlach@mastodon.social 2022-11-22 15:50

    @gabrielesvelto Nice work! Love that redash graph

    Open ##1736083

  • @itamarst@hachyderm.io 2022-11-22 16:02

    @gabrielesvelto This is amazing! Follow-up question: the Bugzilla discussion says "On Linux we have a way to instruct the OOM killer to reap the content processes before the main process when the memory is tight. While we don't use this yet it's something that's feasible." How do you do this exactly? I thought the kernel doesn't have hooks for this. Do you run your own oom detection process? Cgroups? Something else?

    Open ##1736084

  • @forpeterssake@mastodon.xyz 2022-11-22 16:04

    @gabrielesvelto The only kinds of "one weird tricks" I want to read about are the ones already implemented and making everyone's lives better! ๐Ÿ‘

    Open ##1736089

  • @Chirael@infosec.exchange 2022-11-22 16:25

    @gabrielesvelto thank you (and the other devs) for your work on Firefox โค๏ธ๐Ÿ™๐Ÿ‘

    Open ##1736090

  • @TF_Fabrik@mastodon.social 2022-11-22 18:35

    @gabrielesvelto really enjoyed reading it! Funnily this post made it into my podcast app:

    Open ##1736091

  • @mvgrim@hachyderm.io 2022-11-22 18:38

    @gabrielesvelto OS: OOM error Firefox: Noโ€ฆ _A few milliseconds later_ OS: Here's that memory you asked for.

    Open ##1736092

  • @andrea@social.margio.de 2022-11-22 18:49

    @gabrielesvelto woah! Thanks for sharing! ๐Ÿ™๐Ÿป

    Open ##1736093

  • @cabanier@arvr.social 2022-11-22 18:53

    @gabrielesvelto does this also apply to other platforms ie Android?

    Open ##1736094

  • @plwt@mstdn.social 2022-11-22 20:37

    @gabrielesvelto That was a good read, thank you for sharing.

    Open ##1736098

  • @wanderview@toot.cafe 2022-11-22 20:54

    @gabrielesvelto I think this should be called "the snorlax optimization".

    Open ##1736100

  • @nottrobin@fosstodon.org 2022-11-22 22:40

    @gabrielesvelto This is great thanks for writing it up! Side-note: clickbait isn't called clickbait because it's lying, it's because it withholds information to manipulate you into clicking through. To be truly anti-clickbait you could have done your best to describe the "weird trick" right there in the title.

    Open ##1736102

  • @hackworks@hachyderm.io 2022-11-23 01:18

    @gabrielesvelto This reminded me of hearing the lore at McAfee antivirus engine restarting the scan engine (sandbox) since none could fix a memory leak in the gnarly code. The memory usage followed a sawtooth wave with memory dropping when sandbox process was restarted.

    Open ##1736103