Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big memory leak when putting the port into flowing mode #2838

Open
pablo-mendoza opened this issue Jun 27, 2024 · 0 comments
Open

Big memory leak when putting the port into flowing mode #2838

pablo-mendoza opened this issue Jun 27, 2024 · 0 comments

Comments

@pablo-mendoza
Copy link

pablo-mendoza commented Jun 27, 2024

SerialPort Version

12.0.0

Node Version

16.20.2

Electron Version

No response

Platform

Windows

Architecture

x64

Hardware or chipset of serialport

custom usb serial program

What steps will reproduce the bug?

I have a USB to serial device that is producing 2MB/s of data. I'm reading it with the following program

const { SerialPort } = require('serialport')
let port = new SerialPort({
    path: "COM15",
    baudRate: 57600,
})
port.on('open', () => {
})
port.on('data', (data) => {
})

This causes the node process to steadily increase memory usage (as seen in Window's tasks manager active private working set). It jumps very quickly to 400Mb but if leaved to run it keeps going up, I have stopped it around using 2GB of memory.

I have instead run chrome's memory profiler but it doesn't report a big heap so I assume this is leaking memory in the C++ side not in the javascript side.

if I don't call

port.on('data', (data) => {
})

I don't see the increased memory usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant