question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:21 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mykola-mokhnachcommented, Oct 14, 2019

Yep, the trace look much better now. Waiting for the PR to be reviewed and polished. Thank you for the assistance

1reaction
ptaglcommented, Oct 21, 2019

The steps I followed to take the snapshot are:

  1. 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).

  2. Run the command node --inspect . and copy the URL printed on the screen (something like ws://127.0.0.1:9229/0f2c936f-b1cd-4ac9-aab3-f63b0f33d55e).

  3. Open Edge or Chrome and browse to edge://inspect or chrome://inspect respectively. Then paste the URL (or wait for the entry to appear automatically) and press “Inspect”.

  4. In the new window go to the “Memory” tab, select “Allocation instrumentation on timeline” and check “Record allocation stacks”, then start the profiling.

  5. When you collected enough allocations or the application crashed, stop the profiling, wait for the finalization and then save to file.

  6. Optional: if the snapshot file it too big, zip it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found