0

When I run my vue app using npm run serve it says

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

I tried to follow instruction on increasing node_options space to 4096,

I tried to do the following:
1. Control panel > System > Advanced System Settings > Environment Variables
2. Under user variables for <user> > NODE_OPTIONS = --max-old-space-size=8192 #I doubled 4096 since error still persist for 4096

But I still got the same error. Any idea on how I resolve this?

modi
  • 297
  • 2
  • 3
  • 15
  • Does this answer your question? [FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory in ionic 3](https://stackoverflow.com/questions/53230823/fatal-error-ineffective-mark-compacts-near-heap-limit-allocation-failed-javas) – Brian Lee Nov 12 '20 at 03:10
  • 1
    Issue basically relates to poorly optimized code that eventually causes memory leaks in your dev environment. Instead of trying to throw more hardware at it, why not profile your code instead to figure out why that's the case? – Ohgodwhy Nov 12 '20 at 06:06
  • @Ohgodwhy yes, but hard to track where it went wrong since it has a long line of code, basically made new version of this component T_T – modi Nov 12 '20 at 06:30
  • You have a memory leak most likely, and a big one at that. You need to profile the JS and find the cause of the leak. – Jordan Quartermain Nov 12 '20 at 06:46
  • Based on your info, this could be happening because of code that you have in `created()` or `mounted()` you don't un-do in `beforeDestroy()` or `destroyed()` in your dev environment and the HMR isn't releasing the memory causing this leak. – Ohgodwhy Nov 12 '20 at 07:52

0 Answers0