title: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory Angular 13 application
body: <p>I have upgraded the angular application from 12 to 13 and added the eslint and Prettier.</p>
  <p>While doing the ng lint I am facing the below error</p>
  <pre><code>macbook@macbooks-MacBook-Air LegalRegTech.Web.Host % ng lint
  
  Linting &quot;abp-zero-template&quot;...
  
  &lt;--- Last few GCs ---&gt;
  
  [18697:0x7f8814800000]   899728 ms: Mark-sweep (reduce) 2036.5 (2081.8) -&gt; 2035.8 (2082.5) MB, 6232.4 / 0.0 ms  (average mu = 0.155, current mu = 0.048) allocation failure scavenge might not succeed
  [18697:0x7f8814800000]   906650 ms: Mark-sweep (reduce) 2036.1 (2082.5) -&gt; 2036.0 (2082.5) MB, 6313.6 / 0.0 ms  (average mu = 0.122, current mu = 0.088) allocation failure GC in old space requested
  
  
  &lt;--- JS stacktrace ---&gt;
  
  FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
   1: 0x101c5a0e5 node::Abort() [/usr/local/bin/node]
   2: 0x101c5a268 node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
   3: 0x101dd0597 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
   4: 0x101dd0533 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
   5: 0x101f6ee55 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
   6: 0x101f72e7b v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
   7: 0x101f6f75c v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
   8: 0x101f6cc0a v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
   9: 0x101f79f60 v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
  10: 0x101f79fe1 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
  11: 0x101f46f37 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
  12: 0x1022f2fbf v8::internal::Runtime_AllocateInOldGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
  13: 0x102694d99 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
  14: 0x106be229f 
  zsh: abort      ng lint
  </code></pre>
  <p>Here is the eslint configuration</p>
  <pre><code>{
    &quot;root&quot;: true,
    &quot;ignorePatterns&quot;: [
      &quot;projects/**/*&quot;
    ],
    &quot;overrides&quot;: [
      {
        &quot;files&quot;: [
          &quot;*.ts&quot;
        ],
        &quot;parserOptions&quot;: {
          &quot;project&quot;: [
            &quot;src/tsconfig.json&quot;,
            &quot;e2e/tsconfig.json&quot;
          ],
          &quot;createDefaultProgram&quot;: true
        },
        &quot;extends&quot;: [
          &quot;plugin:@angular-eslint/recommended&quot;,
          &quot;plugin:@angular-eslint/template/process-inline-templates&quot;
        ],
        &quot;plugins&quot;: [&quot;prettier&quot;],
        &quot;rules&quot;: {
          &quot;prettier/prettier&quot;: [&quot;error&quot;],
          &quot;@angular-eslint/component-selector&quot;: [
            &quot;error&quot;,
            {
              &quot;prefix&quot;: &quot;app&quot;,
              &quot;style&quot;: &quot;kebab-case&quot;,
              &quot;type&quot;: &quot;element&quot;
            }
          ],
          &quot;@angular-eslint/directive-selector&quot;: [
            &quot;error&quot;,
            {
              &quot;prefix&quot;: &quot;app&quot;,
              &quot;style&quot;: &quot;camelCase&quot;,
              &quot;type&quot;: &quot;attribute&quot;
            }
          ]
        }
      },
      {
        &quot;files&quot;: [
          &quot;*.html&quot;
        ],
        &quot;extends&quot;: [
          &quot;plugin:@angular-eslint/template/recommended&quot;
        ],
        &quot;rules&quot;: {}
      }
    ]
  }
  </code></pre>
  <p>Script in package.json</p>
  <pre><code>&quot;scripts&quot;: {
      &quot;ng&quot;: &quot;ng&quot;,
      &quot;publish&quot;: &quot;ng build --prod&quot;,
      &quot;start&quot;: &quot;ng serve --host 0.0.0.0 --port 4200&quot;,
      &quot;hmr&quot;: &quot;ng serve --host 0.0.0.0 --port 4200 --hmr&quot;,
      &quot;test&quot;: &quot;node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng test&quot;,
      &quot;pree2e&quot;: &quot;webdriver-manager update --standalone false --gecko false&quot;,
      &quot;e2e&quot;: &quot;protractor&quot;,
      &quot;verbose&quot;: &quot;ng serve --host 0.0.0.0 --port 4200 --verbose&quot;,
      &quot;bundle-report&quot;: &quot;webpack-bundle-analyzer dist/stats.json&quot;,
      &quot;analyze&quot;: &quot;ng build --prod --stats-json &amp;&amp; webpack-bundle-analyzer dist/stats.json&quot;,
      &quot;memstart&quot;: &quot;node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --port 4200&quot;,
      &quot;start-dev&quot;: &quot;node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --port 4200 --configuration=development --open&quot;,
      &quot;lint&quot;: &quot;ng lint&quot;
    },
  </code></pre>