This gist contains the files to demonstrate the problem described in p5.serialserver leaking memory.
To run this, you'll need an "Arduino-like device" with a USB port capable of generating
serial data continually. The provided sketch (sketch.ino) shows one way do to that.
Connect your Arduino-like device to your host computer (e.g laptop or desktop), compile
and flash sketch.ino
into your Arduino-like device, and start it running.
Next, you'll need to fire up the p5.serial server. Here are instructions on how to do that. In this example, we'll assume that you've chosen the command line version. It will probably look something like this:
$ sudo npm install -g p5.serialserver
$ p5erial
Copy sketch.js (from this gist) and index.html (from this gist) into the directory of your choice. Download p5.js and p5.serialport into that directory. Launch the web browser of your choice (I've been using Chrome) and open index.html. Also open the Developer Tools or whatever your browser provides for viewing the Javascript Console.
Open the process viewer of your choice. (On Mac OSX it's called Activity Monitor.) Find the server process (in my case, it was just called 'node').
On the Javascript console, you should see a string of text with an ever-increasing prefix. You should observe that the numbers update quickly at first, but then become more and more sluggish as the server's memory size grows and grows.