Closed sopepos closed 6 years ago
Hi,
Thanks much for spotting this, that was a bad bug!
After looking at your patch and investigating the code, I decided to solve this differently. Instead of Nan::CopyBuffer I'm now using Nan::NewBuffer. According to the Nan documentation, this takes care of calling free
on the provided C++ buffer when the Node Buffer is garbage collected, and it saves an unnecessary buffer copy operation in the process.
According to my testing this solves the problem. Please let me know if it works as expected in your testing as well, and close this if it does.
Thanks for fast update. I ran my test code with 0.2.4 for 1 hour and there's no memory leak. Great! 👍 I close this pull request.
I fixed memory leak. (added 3 "delete[] xxx") Without this code, RSS increases while heap is stable.