Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocation failed - process out of memory #392

Closed
bdauria opened this issue Aug 10, 2016 · 5 comments
Closed

Allocation failed - process out of memory #392

bdauria opened this issue Aug 10, 2016 · 5 comments

Comments

@bdauria
Copy link

bdauria commented Aug 10, 2016

I'm getting a 'FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory error' while trying to sync changes using livesync. The only fancy stuff i'm doing is through the following function, which uses the native Android API to apply a linear gradient to a given View:

export function setupBackgroundGradient(view: View, colorCodes: string[], stops: number[]) {
  var backgroundDrawable = new android.graphics.drawable.GradientDrawable();
  var colors = [];
  colorCodes.forEach(function(c) {
    let color = new Color(c);
    colors.push(color.android);
  });
  backgroundDrawable.setColors(colors);
  backgroundDrawable.setGradientType(0); // Linear Gradient
  var orientation = android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT;
  backgroundDrawable.setOrientation(orientation);
  backgroundDrawable.setAlpha(225);
  view.android.setBackgroundDrawable(backgroundDrawable);
}

The log trace is the following:

10:26:55 PM - File change detected. Starting incremental compilation...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory


<--- Last few GCs --->

  170921 ms: Scavenge 1388.6 (1456.5) -> 1388.6 (1456.5) MB, 7.9 / 0 ms (+ 1.8 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
  172462 ms: Mark-sweep 1388.6 (1456.5) -> 1388.5 (1456.5) MB, 1540.4 / 0 ms (+ 3.9 ms in 23 steps since start of marking, biggest step 1.8 ms) [last resort gc].
  173984 ms: Mark-sweep 1388.5 (1456.5) -> 1388.5 (1456.5) MB, 1522.1 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x98f621b4629 <JS Object>
    1: modifierToFlag [/home/bruno/workspace/Signup-Test/node_modules/typescript/lib/tsc.js:~5365] [pc=0x9cd044e7cc3] (this=0x24d1bbcb35b9 <an Object with map 0x2997c117b269>,token=111)
    2: checkGrammarModifiers(aka checkGrammarModifiers) [/home/bruno/workspace/Signup-Test/node_modules/typescript/lib/tsc.js:23930] [pc=0x9cd01816162] (this=0x98f621041b9 <undefined>,node=0x160...

What's strange is that this doesn't come up 100% of the time, and not only when I make a change to the file containing the setBackgroundGradient function... and when I restart livesync, it works perfectly fine, at least for the first compilation.

Any idea where that might be coming from?

@m-abs
Copy link
Contributor

m-abs commented Aug 12, 2016

I see this alot too.

@m-abs
Copy link
Contributor

m-abs commented Sep 8, 2016

Have you found a solution? It's getting really annoying

@bdauria
Copy link
Author

bdauria commented Sep 12, 2016

Well actually, since 2.2.1 I'm getting less of these (It still comes from time to time though), so for now it's acceptable.
What version do you use?

@roblav96
Copy link

It's really annoying, trying to figure out how to increase this with --max_old_space_size=4096

@NickIliev
Copy link

Solution with increasing the max_old_space_size`` is discussed here.

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants