Closed. This question is off-topic. It is not currently accepting answers. 开发者_开发知识库 Want to improve this question? Update the question so it's on-topic for Stack Overflow.
The following code seems like very simple, but I have no idea why it generates a "heap out of memory" when size is bigger. The nodejs v18.12.1 is using.