Skip to content Skip to sidebar Skip to footer

How To Overcome Nodejs Heap Memory Error?

I have a connected database in my NodeJS with 723.1 MB in size but facing the same trouble about memory size. What I am doing is am making my database as API so that I can request

Solution 1:

Try increasing old space size to 4096 rather than 2048

node --max-old-space-size=4096 index.js

Solution 2:

What I did was I used LIMIT CLAUSE just to display on my table.

SELECT*FROMTABLEORDERBY F_NAME LIMIT 1000

It was a dumb idea to display whole database on my frontend and it exceeds the limit of NODEJS that's why I faced the issue but came to my mind that I will just limit it and it works obviously.

Post a Comment for "How To Overcome Nodejs Heap Memory Error?"