0

I am testing tree search algorithms in node.js. The trees are just objects (representing nodes on the tree) that contain arrays of references to their 'child' nodes.

However, I am finding that I am often running out of memory. I've only eye-balled task manager before it crashes, but it seems to top out at 2gb.

What language features and options should I use to fix this? I know about buffers. Could I perhaps stores subtrees in multiple buffers? However a buffer is essentially an array right?

Ryan Keathley
  • 49
  • 1
  • 5
  • Does this help? it implies that 2G is the default limit. I assume you have a lot more than that available? https://support.circleci.com/hc/en-us/articles/360009208393-How-can-I-increase-the-max-memory-for-Node- – Nick.Mc Aug 02 '21 at 00:16
  • More discussion here https://stackoverflow.com/questions/7193959/memory-limit-in-node-js-and-chrome-v8 – Nick.Mc Aug 02 '21 at 00:18
  • thank you I think allocating more heap memory is probably the best solution – Ryan Keathley Aug 02 '21 at 01:05
  • If you try this and have success, please post an answer here to help others. – Nick.Mc Aug 02 '21 at 01:10

0 Answers0