FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
See original GitHub issueThe problem
Hi,
I am currently using Appium for a test application that monitors the status of an Android smartphone. In particular my application runs for many hours and needs to collect many screenshots of the smartphone during the execution (by using the getScreenshot function).
After some hours and hundreds of screenshots collected the Appium server crashed with the following error:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
In order to reproduce the issue I guess it is enough to put the getScreenshot
function in an infinite loop.
Environment
- Appium version: 1.14.2
- Desktop OS/version: Windows 10 1903 64 bit
- Node.js version: 12.6.0
- Npm or Yarn package manager:
- Mobile platform/version under test: Android 9 Pie
- Real device: Samsung S9
- Additional parameters to run Appium: --relaxed-security
Link to Appium logs
I collected log output from two different crashes:
https://gist.github.com/ptagl/0c189d8343daebc22a8e580e4d02b7a1 https://gist.github.com/ptagl/a33dac0702cf55e6e5dbaeb4ae1190be
Issue Analytics
- State:
- Created 4 years ago
- Comments:21 (1 by maintainers)
Top Results From Across the Web
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed ...
Your code works fine for me with Node.js 0.10.28. It took 1200 MB of virtual memory and printed an unbelievable amount of junk...
Read more >JavaScript heap out of memory - Snyk Support
FATAL ERROR : CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of ... You can increase the amount of memory allocated to the command...
Read more >How to resolve - FATAL ERROR: CALL_AND_RETRY_LAST ...
FATAL ERROR : CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory How to get rid of this issue?Is it related to physical ......
Read more >How to solve JavaScript heap out of memory error
The fatal error says JavaScript heap out of memory as seen below: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out ...
Read more >FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed
I'm trying to deploy my app but I'm getting this error: 7:13:48 PM: Creating an ... Allocation failed - JavaScript heap out of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, the trace look much better now. Waiting for the PR to be reviewed and polished. Thank you for the assistance
The steps I followed to take the snapshot are:
Open the terminal and go to the Appium module folder (in case of Windows OS something like C:\Users\username\AppData\Roaming\npm\node_modules\appium).
Run the command
node --inspect .
and copy the URL printed on the screen (something likews://127.0.0.1:9229/0f2c936f-b1cd-4ac9-aab3-f63b0f33d55e
).Open Edge or Chrome and browse to
edge://inspect
orchrome://inspect
respectively. Then paste the URL (or wait for the entry to appear automatically) and press “Inspect”.In the new window go to the “Memory” tab, select “Allocation instrumentation on timeline” and check “Record allocation stacks”, then start the profiling.
When you collected enough allocations or the application crashed, stop the profiling, wait for the finalization and then save to file.
Optional: if the snapshot file it too big, zip it.