Ionic build --prod takes so long and finishes with GC memory leak

#1

Hi team, I have been working on my project since few months and now I am facing this issue. My app is not that huge and I tried a lot of proposed workarounds here like setting the memory for node … when trying to build, but in vain. I am really stuck here.

It is a problem with webpack I guess and even when I increased to memory to 8GB it blocks my OS and still getting the same issue. I tried with both Ubuntu an Windows Os, and here are the ionic info and my package.json.

IONIC INFO

cli packages: (/usr/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : not installed

local packages:

    @ionic/app-scripts : 3.1.10
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.11.3
    npm  : 5.10.0 
    OS   : Linux 4.13

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

Package.json

"dependencies": {
    "@angular/common": "5.0.3",
    "@angular/compiler": "5.0.3",
    "@angular/compiler-cli": "5.0.3",
    "@angular/core": "5.0.3",
    "@angular/forms": "5.0.3",
    "@angular/http": "5.0.3",
    "@angular/platform-browser": "5.0.3",
    "@angular/platform-browser-dynamic": "5.0.3",
    "@ionic-native/call-number": "^4.7.0",
    "@ionic-native/core": "^4.7.0",
    "@ionic-native/diagnostic": "^4.5.2",
    "@ionic-native/firebase": "^4.5.3",
    "@ionic-native/geolocation": "^4.5.2",
    "@ionic-native/google-maps": "^4.8.2",
    "@ionic-native/keyboard": "^4.5.2",
    "@ionic-native/native-geocoder": "^4.5.2",
    "@ionic-native/network": "^4.5.2",
    "@ionic-native/screen-orientation": "^4.5.2",
    "@ionic-native/splash-screen": "4.4.0",
    "@ionic-native/status-bar": "^4.4.0",
    "@ionic/app-scripts": "^3.1.10",
    "@ionic/pro": "1.0.16",
    "@ionic/storage": "^2.1.3",
    "@ngx-translate/core": "^9.0.2",
    "@ngx-translate/http-loader": "^2.0.1",
    "angularfire2": "^5.0.0-rc.5-next",
    "call-number": "^1.0.1",
    "cordova-android": "6.3.0",
    "cordova-plugin-device": "^1.1.7",
    "cordova-plugin-firebase": "^0.1.25",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-googlemaps": "^2.3.6",
    "cordova-plugin-ionic-webview": "^1.2.1",
    "cordova-plugin-nativegeocoder": "^2.0.5",
    "cordova-plugin-network-information": "^1.3.4",
    "cordova-plugin-screen-orientation": "^2.0.2",
    "cordova-plugin-splashscreen": "^4.1.0",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova.plugins.diagnostic": "^3.9.2",
    "es6-promise-plugin": "^4.2.2",
    "firebase": "^4.10.0",
    "imgcache.js": "^1.1.1",
    "ionic-angular": "^3.9.2",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "minimist": "^1.2.0",
    "npm": "^5.10.0",
    "promise-polyfill": "^6.1.0",
    "rxjs": "5.5.2",
    "sw-toolbox": "3.6.0",
    "xml2js": "^0.4.19",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.2",
    "typescript": "2.4.2",
    "uglify-es": "3.2.2"
  }
#2

I ended up with creating new project and migrate all my work in.

1 Like