title: Angular FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed
body: <p>I've used Angular 5<br>
  I try <code>ng build --prod</code><br>
  show this error: <br>
  <code>FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory</code></p>
  
  <p>I've read <a href="https://stackoverflow.com/questions/53685008/improving-production-build-time-for-angular-7-application">this</a> and <a href="https://stackoverflow.com/questions/48906968/ng-build-prod-have-javascript-heap-out-of-memory-error">this</a> and change <code>-max_old_space_size</code> in <code>package.json</code> but does not build production show above error again.<br>
  What's the problem? How can solve it? Is the problem of package.json؟<br></p>
  
  <p><strong>package.json:</strong></p>
  
  <pre><code>{
    "name": "asd",
    "version": "0.6.2",
    "license": "MIT",
    "angular-cli": {},
    "scripts": {
      "build:dev": "./node_modules/.bin/ng build",
      "build:prod": "./node_modules/.bin/ng build --prod --aot=false",
      "build:aot": "./node_modules/.bin/ng build --prod --aot",
      "build:aot2": "node --max_old_space_size=4096 ./node_modules/.bin/ng build --prod --aot",
      "build": "npm run build:dev",
      "clean:dist": "npm run rimraf -- dist",
      "clean:install": "npm set progress=false &amp;&amp; npm install",
      "clean:start": "npm start",
      "clean": "npm cache clean &amp;&amp; npm run rimraf -- node_modules doc coverage dist",
      "e2e:live": "npm run e2e -- --elementExplorer",
      "e2e": "npm run protractor",
      "lint": "npm run tslint \"src/**/*.ts\"",
      "prebuild:dev": "npm run clean:dist",
      "prebuild:prod": "npm run clean:dist",
      "preclean:install": "npm run clean",
      "preclean:start": "npm run clean",
      "protractor": "protractor",
      "rimraf": "rimraf",
      "server:dev": "./node_modules/.bin/ng serve",
      "serve": "npm run server:dev",
      "start": "npm run server:dev",
      "test": "./node_modules/.bin/ng test",
      "tslint": "tslint",
      "typedoc": "typedoc",
      "ng": "ng",
      "pree2e": "webdriver-manager update --standalone false --gecko false"
    },
    "private": true,
    ....
  }
  </code></pre>