Crash on every save while using --livesync and --watch


#1

Hey guys, this issue is really starting to impact our developer’s dev cycles because it is a constant re-occurrences.

Basically on each save while we are using

tns livesync ios --emulator --watch

we would get this crash log

11:17:40 AM - File change detected. Starting incremental compilation...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory


<--- Last few GCs --->

   46320 ms: Scavenge 1397.6 (1456.7) -> 1397.6 (1456.7) MB, 2.5 / 0 ms [allocation failure].
   46323 ms: Scavenge 1397.6 (1456.7) -> 1397.6 (1456.7) MB, 2.5 / 0 ms [allocation failure].
   46325 ms: Scavenge 1397.6 (1456.7) -> 1397.6 (1456.7) MB, 2.1 / 0 ms [allocation failure].
   47296 ms: Mark-sweep 1397.6 (1456.7) -> 1397.6 (1456.7) MB, 971.1 / 0 ms [last resort gc].
   48265 ms: Mark-sweep 1397.6 (1456.7) -> 1397.6 (1456.7) MB, 969.3 / 0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 0x2bb3136b4629 <JS Object>
    1: addInheritedMembers(aka addInheritedMembers) [/Users/USER/dev/tinder/tinderApp/node_modules/typescript/lib/tsc.js:~16824] [pc=0x1391ff522769] (this=0x2bb3136041b9 <undefined>,symbols=0xe871ec65951 <an Object with map 0x3b79d61ad041>,baseSymbols=0xe871ec66301 <JS Array[445]>)
    2: resolveObjectTypeMembers(aka resolveObjectTypeMembers) [/Users/USER/dev/tinder/tinderAp...

Does anyone know anything about how we can solve this issue? Much appreciated.

Regards.


#2

Does this reference to ‘tinder’ have to do with your app, or is it possibly some conflict with an installed Tinder app? Sorry if this is a dumb question but this caught my eye (WHAT are you developing!?)


#3

My next recommendation after uninstalling any conflicting apps would be to reset your simulator


#4

LOL, no I just used the name Tinder to mask my app name. Nothing to do with Tinder :wink:


#5

So uninstall app from simulator and what do you mean by reset your simulator?


#6

#7

Still experiencing the crash :fearful:


#8

are you using any sort of plugin? Time to strip down your code and see what’s going on. Livesync normally works ok!


#9

Here is my package.json

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "ca.notRealTinder.app.user",
    "tns-ios": {
      "version": "2.3.0"
    }
  },
  "dependencies": {
    "nativescript-dev-sass": "^0.4.1",
    "nativescript-geolocation": "0.0.14",
    "nativescript-timedatepicker": "^1.0.0",
    "tns-core-modules": "^2.5.0-2016-10-28-4598",
    "tns-platform-declarations": "^2.4.0-2016-09-28-1"
  },
  "devDependencies": {
    "nativescript-dev-typescript": "^0.3.2",
    "typescript": "^2.0.6"
  }
}

Let me know if you want to see anything else! Thanks for the help Jen!


#10

I am using tns-ios 2.4.0, and this jumped out:

“tns-core-modules”: “^2.5.0-2016-10-28-4598”,
“tns-platform-declarations”: “^2.4.0-2016-09-28-1”

Those seem to be unstable releases, you sure you need those?


#11

Hmm I can’t remember the reason why I added that in. I think it’s because for the Flex support?

Also it could be because I wanted to do this

if (page.ios) {
    var navigationBar = frame.topmost().ios.controller.navigationBar;
    navigationBar.translucent = false;
    navigationBar.barStyle = 0;
    page.backgroundSpanUnderStatusBar = true;
    page.actionBarHidden = false;
}

For the status bar to be non default etc

How do I make it go back to stable? Should I just delete it? I can try and see if anything breaks?


#12

That looks like an OOM exception coming from the Angular/TypeScript compiler. What is your setup and available memory?

Check this out for more information -> http://stackoverflow.com/questions/26094420/fatal-error-call-and-retry-last-allocation-failed-process-out-of-memory


#13

Solved this by following upgrade instructions provided here http://docs.nativescript.org/releases/upgrade-instructions