We have a suite of 75 tests where appium gets aborted in the middle of the run (runs lasting ~1-3 hours before failing, fails at different times) with the console output saying one of these memory issues:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
If a test fails we do stop and start the driver again, and this happens often enough to keep the driver from getting stale. The appium logs are incredibly long (8500 lines), so rather than filling up the page with them I’ve included the end of the logs. If needed I can provide all of them.
[details=Appium Logs][HTTP] <-- POST /wd/hub/session/baaef51d-01b5-47eb-bb3c-ec585df515a8/element 200 774 ms - 89
[HTTP] --> POST /wd/hub/session/baaef51d-01b5-47eb-bb3c-ec585df515a8/element/235/click {"{}":""}
[debug] [MJSONWP] Calling AppiumDriver.click() with args: [“235”,“baaef51d-01b5-47eb-bb3c-ec585df515a8”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“235”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“235”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/baaef51d-01b5-47eb-bb3c-ec585df515a8/element/235/click 200 471 ms - 76
[HTTP] --> POST /wd/hub/session/baaef51d-01b5-47eb-bb3c-ec585df515a8/element {“using”:“xpath”,“value”:"//[@text=“Document5.xlsx”]"}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“xpath”,"//[@text=“Document5.xlsx”]",“baaef51d-01b5-47eb-bb3c-ec585df515a8”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 30000 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:"//[@text=“Document5.xlsx”]",“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:"//[@text=“Document5.xlsx”]",“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//[@text=“Document5.xlsx”]’ using ‘XPATH’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=11]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“236”}}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“236”}
[HTTP] <-- POST /wd/hub/session/baaef51d-01b5-47eb-bb3c-ec585df515a8/element 200 1484 ms - 89
[HTTP] --> POST /wd/hub/session/baaef51d-01b5-47eb-bb3c-ec585df515a8/element/236/click {"{}":""}
[debug] [MJSONWP] Calling AppiumDriver.click() with args: [“236”,“baaef51d-01b5-47eb-bb3c-ec585df515a8”]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“236”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“236”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/baaef51d-01b5-47eb-bb3c-ec585df515a8/element/236/click 200 402 ms - 76
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}
[HTTP] --> POST /wd/hub/session/baaef51d-01b5-47eb-bb3c-ec585df515a8/element {“using”:“xpath”,“value”:"//[@text=“Document5.xlsx”]"}
<— Last few GCs —>
[41946:0x103002000] 2455490 ms: Mark-sweep 1454.4 (1490.5) -> 1454.4 (1489.5) MB, 2858.0 / 0.0 ms (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2858 ms) last resort
[41946:0x103002000] 2458489 ms: Mark-sweep 1454.4 (1489.5) -> 1454.4 (1489.5) MB, 2999.0 / 0.0 ms last resort
<— JS stacktrace —>
==== JS stack trace =========================================
Security context: 0x270a2be26729
1: clone [/usr/local/Cellar/nvm/0.31.0/versions/node/v7.6.0/lib/node_modules/appium/node_modules/winston/lib/winston/common.js:~79] [pc=0x18dcf1b59d9a](this=0x1eb309049929 <an Object with map 0x340627bdbe31>,obj=0x2af6fa2b821 <an Object with map 0x2058a817ab21>)
2: log [/usr/local/Cellar/nvm/0.31.0/versions/node/v7.6.0/lib/node_modules/appium/node_modules/winston/lib/winston/common.js:2…
[/details]
Appium version :1.6.3 and 1.5.3 (tried on both)
Node version: 7.6.0
Has anyone run into this issue or know of any possible solutions? Any help would be greatly appreciated.