For a non-Angular general answer for those who land on this question from Google:
Every time you face this error it’s probably because of a memory leak or difference between how Node.js <= 10 and Node.js > 10 manage memory.
Usually just increasing the memory allocated to Node.js will allow your program to run but may not actually solve the real problem and the memory used by the node process could still exceed the new memory you allocate. I'd advise profiling memory usage in your Node.js process when it starts running or updating to Node.js > 10.
I had a memory leak. Here is a great article on debugging memory leaks in Node.js.
That said, to increase the memory, in the terminal where you run your Node.js process:
export NODE_OPTIONS="--max-old-space-size=8192"
where values of can be: etcmax-old-space-size
[2048, 4096, 8192, 16384]
More examples for further clarity:
export NODE_OPTIONS="--max-old-space-size=5120" # Increase to 5 GB
export NODE_OPTIONS="--max-old-space-size=6144" # Increase to 6 GB
export NODE_OPTIONS="--max-old-space-size=7168" # Increase to 7 GB
export NODE_OPTIONS="--max-old-space-size=8192" # Increase to 8 GB
# and so on...
# formula:
export NODE_OPTIONS="--max-old-space-size=(X * 1024)" # Increase to X GB
# Note: it doesn't have to be multiples of 1024.
# max-old-space-size can be any number of memory megabytes (MB) you have available.
See the current value of max-old-space-size (in MB)
To see the current (not exact but very close) value of max-old-space-size (in MB), run in your terminal
node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))'
In my case, I fixed this problem by installing Node.js, version 12.10.0.
-
-
-
java string.getBytes(“UTF-8”) javascript equivalent 我在java中有这个字符串: 我的印象是 unescape(encodeURIComponent()) 会正确地将字符串转换为 UTF-8。难道不是这样吗? 参考:
-
在 REST API 调用之前对 meta 进行 OPTIONS 调用 我试图理解这个系统是如何在引擎盖下工作的。该系统是基于非常标准的,我没有得到的客户端在每次API调用之前进行调用,并且XML内容以该格式返回。它使用泽西爪哇。 B.此调用是由浏览器自
-
使用 Java 进行 AES 加密,并使用 Javascript 进行解密 我正在制作一个应用程序,它需要基于Java的AES加密和基于JavaScript的解密。我使用以下代码进行加密作为基本形式。