Skip to content

Instantly share code, notes, and snippets.

@flotwig
Last active Jul 22, 2020
Embed
What would you like to do?
Firefox OOM crash

Running on a VM of Fedora Workstation 31 with Firefox 73.0a1. VM had 5.2GiB of RAM with swap disabled.

Since Fedora will kill Firefox once OOM occurs, I had to manually stop recording when I guessed that there was "almost" not enough RAM left (around 750Mi of RAM).

Notice how, with forced GC+CC after each test, available RAM drops until it stabilizes around 1 GiB. Without forced GC+CC, available RAM drops until an OOM occurs.

Cypress spec code to reproduce

const { _ } = Cypress

_.times(500, (i) => {
	it(`test #${i}`, () => {
		cy.visit('https://dashboard.cypress.io')
	})
})

Profiling WITHOUT forced GC+CC

Firefox performance profile: https://perfht.ml/36ezaLu

Log of `free -h` output:
Mon 30 Dec 2019 12:28:17 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       1.2Gi       3.2Gi        15Mi       732Mi       3.7Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:28:32 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.1Gi       2.2Gi        42Mi       886Mi       2.8Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:28:47 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.3Gi       1.9Gi        50Mi       929Mi       2.6Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:29:02 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.5Gi       1.7Gi        50Mi       929Mi       2.4Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:29:17 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.6Gi       1.6Gi        51Mi       933Mi       2.3Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:29:32 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.9Gi       1.4Gi        51Mi       933Mi       2.1Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:29:47 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.0Gi       1.3Gi        51Mi       939Mi       1.9Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:30:02 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.2Gi       1.0Gi        51Mi       939Mi       1.7Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:30:17 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.3Gi       939Mi        51Mi       939Mi       1.6Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:30:32 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.5Gi       762Mi        51Mi       940Mi       1.4Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:30:47 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.7Gi       549Mi        51Mi       946Mi       1.2Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:31:02 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       367Mi        51Mi       945Mi       1.1Gi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:31:17 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       4.0Gi       197Mi        51Mi       946Mi       908Mi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:31:32 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       4.2Gi       175Mi        51Mi       780Mi       713Mi
Swap:            0B          0B          0B
Mon 30 Dec 2019 12:31:47 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       4.4Gi       167Mi       158Mi       574Mi       343Mi
Swap:            0B          0B          0B

Short profile with "Native Allocations" enabled: https://perfht.ml/2QaLUxe

Profiling WITH forced GC+CC

Firefox performance profile: https://perfht.ml/2Q1ZPWh

Log of `free -h` output (note that it eventually stabilizes):
Fri 27 Dec 2019 05:01:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.2Gi       1.9Gi        55Mi       1.1Gi       2.8Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:01:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.3Gi       1.8Gi        53Mi       1.1Gi       2.7Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:01:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.3Gi       1.8Gi        53Mi       1.1Gi       2.6Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:01:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.4Gi       1.6Gi        53Mi       1.1Gi       2.5Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:02:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.5Gi       1.6Gi        53Mi       1.1Gi       2.4Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:02:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.5Gi       1.5Gi        54Mi       1.1Gi       2.4Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:02:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.6Gi       1.4Gi        58Mi       1.1Gi       2.3Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:02:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.7Gi       1.3Gi        53Mi       1.1Gi       2.2Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:03:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.8Gi       1.3Gi        53Mi       1.1Gi       2.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:03:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.9Gi       1.2Gi        53Mi       1.1Gi       2.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:03:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       2.9Gi       1.1Gi        54Mi       1.1Gi       2.0Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:03:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.0Gi       1.0Gi        54Mi       1.1Gi       1.9Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:04:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.0Gi       1.0Gi        54Mi       1.1Gi       1.9Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:04:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.1Gi       949Mi        54Mi       1.1Gi       1.8Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:04:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.1Gi       915Mi        54Mi       1.1Gi       1.8Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:04:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.2Gi       830Mi        55Mi       1.1Gi       1.7Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:05:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.2Gi       805Mi        55Mi       1.1Gi       1.7Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:05:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.3Gi       753Mi        55Mi       1.1Gi       1.6Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:05:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.3Gi       724Mi        55Mi       1.1Gi       1.6Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:05:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.4Gi       688Mi        54Mi       1.1Gi       1.6Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:06:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.4Gi       624Mi        54Mi       1.1Gi       1.5Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:06:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.4Gi       605Mi        54Mi       1.1Gi       1.5Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:06:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.5Gi       598Mi        54Mi       1.1Gi       1.5Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:06:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.5Gi       532Mi        54Mi       1.1Gi       1.4Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:07:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.5Gi       516Mi        54Mi       1.1Gi       1.4Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:07:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.6Gi       482Mi        54Mi       1.1Gi       1.4Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:07:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.6Gi       418Mi        54Mi       1.1Gi       1.3Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:07:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.6Gi       402Mi        54Mi       1.1Gi       1.3Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:08:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.7Gi       344Mi        54Mi       1.1Gi       1.2Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:08:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.7Gi       303Mi        54Mi       1.1Gi       1.2Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:08:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.8Gi       263Mi        56Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:08:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.8Gi       253Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:09:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.8Gi       237Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:09:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.8Gi       232Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:09:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.8Gi       217Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:09:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       208Mi        54Mi       1.1Gi       1.0Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:10:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.8Gi       244Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:10:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       239Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:10:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       235Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:10:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       235Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:11:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       235Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:11:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       230Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:11:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.8Gi       245Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:11:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.8Gi       245Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:12:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.8Gi       257Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:12:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       240Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:12:30 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       236Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:12:45 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       238Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:13:00 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       238Mi        54Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B
Fri 27 Dec 2019 05:13:15 PM EST
              total        used        free      shared  buff/cache   available
Mem:          5.2Gi       3.9Gi       227Mi        56Mi       1.1Gi       1.1Gi
Swap:            0B          0B          0B

Short profile with "Native Allocations" enabled: https://perfht.ml/2QAvkpc

@whimboo

This comment has been minimized.

Copy link

@whimboo whimboo commented Jul 22, 2020

Would you mind testing again with the latest Firefox Nightly build? We just got https://bugzilla.mozilla.org/show_bug.cgi?id=1608501 fixed, and would be interested to see if it is also fixed for you now. If you aren't using a Nightly build yet, you can download one from https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment