Look into adding `--disable-dev-shm-usage` Chrome flag
See original GitHub issueCurrent behavior:
Cypress doesn’t pass --disable-dev-shm-usage
: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/browsers/chrome.coffee#L21
But Puppeteer does: https://github.com/GoogleChrome/puppeteer/blob/master/lib/Launcher.js#L37
However, in this commit that adds --disable-dev-shm-usage
, it seems to cause failures to start Chrome: 7247dcfa78ad3e1d0ad032474e724a083007edda
It may be because Cypress does not run Chrome headlessly: #832
Desired behavior:
Cypress passes --disable-dev-shm-usage
so that machines with small /dev/shm
s can run Cypress.
Original issue: #3633
Workaround (4.0.0 and up)
A user can modify Chrome flags by adding this in their pluginsfile:
module.exports = (on, config) => {
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.family === 'chrome') {
console.log('Adding --disable-dev-shm-usage...')
launchOptions.args.push('--disable-dev-shm-usage')
}
return launchOptions
})
}
Workaround (pre-4.0.0)
A user can modify Chrome flags by adding this in their pluginsfile:
module.exports = (on, config) => {
on('before:browser:launch', (browser = {}, args) => {
if (browser.family === 'chromium') {
console.log('Adding --disable-dev-shm-usage...')
args.push('--disable-dev-shm-usage')
}
return args
})
}
Edited by @jennifer-shehane to note browser.family
to equal chromium
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:8 (2 by maintainers)
I was getting this error constantly during normal usage. Usually from doing things like alt-tabbing. I was using the electron version, not chrome, to launch Cypress.
FATAL:memory.cc(22)] Out of memory. size=262144
However, I was running Cypress itself inside of a Docker container. I ended up solving this by mounting the shm directory
--volume=/dev/shm:/dev/shm
so that the docker container had access to all the shm the host machine has available.Did anyone else notice that this command is not working for the new chrome (80)? I upgraded my chrome and the chrome crashes, just like in earlier versions, before this code.