configuration max old space size in Nodejs

后端 未结 2 543
南旧
南旧 2020-12-16 12:54

Im a newbie in nodejs and mongodb. I have a problem when i read about 100000 records from my mongodb in nodejs application. When I try to get 100000 records, I got this erro

2条回答
  •  时光说笑
    2020-12-16 12:54

    Use node --max_old_space_size=5000 yourapp.js to allow 5000 mb. Look in your eclipse launch settings for command-line parameters, where you can add this.

    However, as the comments say, you should reconsider loading this into memory, and stream it to the client instead.

提交回复
热议问题