Skip to content

Allocation failed - process out of memory #392

@bdauria

Description

@bdauria

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions