Ok, I'm scratching my head here. I am playing with the node-serialport library and when I run this script, the memory is eaten up at a rate of 2MB per second:
var SerialPort = require('serialport');
var port = new SerialPort('/dev/ttyAMA0', {
baudRate: 115200
});
// Switches the port into "flowing mode"
port.on('data', function (data) {
console.log('Data:', data.toString() );
});
I don't even have anything connected to the serial port and it just starts eating ram. The weird thing is that I don't have this problem on a raspberry pi zero
(without the wifi). The node versions are the same, the node-serialport
versions are the same, they are both on the same version of Raspbian. I'm at a loss as to where to go next.
Details:
root@raspberrypi:# node -v
v6.11.4
root@raspberrypi:# grep serialport package.json
"serialport": "^6.2.0",
root@raspberrypi:~# lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.3 (stretch)
Release: 9.3
Codename: stretch
root@raspberrypi:~# cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=74121984-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash
I thought it might be this issue but after upgrading to 6.2.0
the issue still persists and now I'm out of ideas. :(
memory is eaten up at a rate of 2MB per second
... change the baud rate .... see if the 2MB per second changes