hashlips_art_engine: (node:11004) UnhandledPromiseRejectionWarning: Error: out of memory

When I tried to generate more than 10K images + Gifs together, I get the heap out or out of memory issue, But I tried compile this with this command by increasing the allocated memory like this, export NODE_OPTIONS=--max_old_space_size=204800 Still it crash in the middle of the generation. Any solution? error

Thank you!

About this issue

Most upvoted comments

It looks like the issue is caused by the loadedElements variable not being GCd after each loop. We could empty it ourselves instead.

@sujeewakabeysinghe after some investigation it looks like there might be a memory leak somewhere. I’ll keep looking.

canvas.toBuffer in saveImage seems to have an impact on performance (~84.4% of the time is spent there). I’ll have a look for the memory leak.

@sujeewakabeysinghe I believe that’s meant to happen (aside from the crashing). Although there is room for optimisation.

@sujeewakabeysinghe could you post a screenshot of task manager (ctrl + shift + esc) when you run into these errors please.