You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just want to mention problem while rendering big amount of data (lets say about 10 pages and more). on small instance server (1Gb memory and lower). There the problem appear and you will end up with memory heap error.
How to solve it:
First of all every Nodejs servers are limited with heap memory, which is usually around 1.8Gb, so to solve it you have to increase heap to 4Gb at least (works for up to 60 pages text size data) with server start with flag --max_old_space_size=4096 exmp: node --max_old_space_size=4096 server.js
for nx run you can use script in packagejson: "nx": "node --max_old_space_size=4096 ./node_modules/@nrwl/cli/bin/nx"
if you get any of the images in the doc than remove it from the memory immediately you add them to rander, like this:
all of this can really help you to solve problem with rendering pdf on low level memory servers. I just faced same problems so I am sharing this out the world. Hope it helps someone.
Happy coding
The text was updated successfully, but these errors were encountered:
I just want to mention problem while rendering big amount of data (lets say about 10 pages and more). on small instance server (1Gb memory and lower). There the problem appear and you will end up with memory heap error.
How to solve it:
node --max_old_space_size=4096 server.js
for nx run you can use script in packagejson:
"nx": "node --max_old_space_size=4096 ./node_modules/@nrwl/cli/bin/nx"
when you use TS with img imported you use this:
all of this can really help you to solve problem with rendering pdf on low level memory servers. I just faced same problems so I am sharing this out the world. Hope it helps someone.
Happy coding
The text was updated successfully, but these errors were encountered: