too many memory consumtion #94

Closed
gideon518j opened this Issue Oct 9, 2012 · 7 comments

Projects

None yet

5 participants

@gideon518j

I run the modify echoTest.js and run on Windows XP. After serval hours, it uses 700M+ memory, what's going wrong ?

/****************************** code ***********************************/

var SerialPort = require("../serialport").SerialPort;
var assert = require('assert');

var keepAlive = setTimeout(function () {
console.log('timeout');
// process.exit();
}, 10000);

var portName;

if (process.platform == 'win32') {
portName = 'COM1';
} else if (process.platform == 'darwin') {
portName = '/dev/cu.usbserial-A800eFN5';
} else {
portName = '/dev/ttyUSB0';
}

//var readData = '';
var sp = new SerialPort(portName, {
baudRate: 115200,
dataBits: 8,
parity: 'none',
stopBits: 1,
flowControl: false
});
sp.on('data', function (data) {
var readData = data.toString();
//console.log(readData);
sp.write(readData, function (err, bytesWritten) {
// console.log('bytes written:', bytesWritten);

});

readDate = '';
readDate = null;
});

sp.on('close', function (err) {
console.log('port closed');
});

sp.on('error', function (err) {
console.error("error", err);
});

sp.on('open', function () {
console.log('port opened... Press reset on the Arduino.');
});

/****************************** code ***********************************/

@joeferner joeferner was assigned Oct 18, 2012
@voodootikigod
Collaborator

Assigning to Joe as he has a windows machine.

@joeferner
Collaborator

Which version of serialport are you using? There have been some recent changes in 1.0.8 that may have fixed this.

@gideon518j

I tested version 1.0.8

@JayBeavers
Collaborator

Closing as dupe of #122

@JayBeavers JayBeavers closed this Jul 25, 2013
@JayBeavers
Collaborator

Reopening this issue and closing #122, as this one has a repro case attached.

@JayBeavers JayBeavers reopened this Oct 26, 2013
@JayBeavers
Collaborator

Two articles which give guidance on how to detect memory leaks in C++ apps on Windows. Will try and apply these:

http://msdn.microsoft.com/en-us/library/974tc9t1.aspx
http://msdn.microsoft.com/en-us/library/e5ewb1h3(v=vs.90).aspx

@reconbot
Collaborator
reconbot commented Apr 2, 2014

@JayBeavers you've attacked a ton of these issues and along with the NAN patch, I'm thinking we should close this. Happy to reopen if this is still an issue.

@reconbot reconbot closed this Apr 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment