Here's what I did, you can find it in the bash history if that is setup right.
ssh pi@ip
cd grblweb-git-orig
npm install
sudo node server.js
It still had the leak after that, so I went and added console output to every function which repeats.
There was no erroneous or extra data, which means that the leak is in an external library that has recently been modified by it's author or co-author.
I then looked at your packages in raspbian and saw all the node packages. I then promptly removed them and the node_modules directory in the grblweb-git-orig directory.
sudo apt-get --purge remove node*
rm -rf ~/grblweb-git-orig/node_modules
First I upgraded all the packages in raspbian.
sudo apt-get update
sudo apt-get upgrade
The upgrades included a kernel upgrade, so I rebooted the device to load the new kernel.
Then I installed the build tools, downloaded the nodejs source from their website and rebuilt nodejs from source.
sudo apt-get install build-essential gcc cmake make
tar -xzvf node-v12.18.3.tar.gz
cd node-v12.18.3
./configure
make
sudo make install
node --version
Then I went back into grblweb, reinstalled the modules and started the server.
cd ~/grblweb-git-orig
npm install
sudo node server.js
I downloaded the image on
xyzbots.com for the rpi 2 and mounted the image on a linux box:
mount -o loop,offset=127926272 xyzbots-reprapweb-grblweb-2015-may.img ./img
Then I looked at the already working and installed set of libraries on the disk image to get their versions because I know they are working.
The 3 external libraries and their versions that work are:
node-static: 0.7.6
serialport: 1.4.10
`npm install` was installing these versions:
node-static: 0.7.11
serialport: 7.0.2
Just get those packages in and it will work like the binaries I provide that are completely open source in my code.
Andrew