Skip to content

Potential memory leak in UDP #6189

@mjesun

Description

@mjesun
  • Version: 4.4.2
  • Platform: Linux (Ubuntu Server 8 - Jessie), kernel 3.16
  • Subsystem: dgram.js

UDP sockets seem to have a memory leak. Seems that it's not the first time it had that, so it feels to me that it might be a regression. The following test code reproduces it:

const Crypto = require('crypto');
const Dgram = require('dgram');

let socket = Dgram.createSocket('udp4');

setInterval(() => {
  for (let i = 0; i < 30; i++) {
    socket.send(Crypto.randomBytes(50), 0, 50, 8125, 'example.org');
  }
}, 10);

Memory grows approximately at a rate of 1 MB/s in my machine. I assume that a UDP socket should just send the data (no matter if no one is listening on the other side), so there should not be this huge memory consumption.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dgramIssues and PRs related to the dgram subsystem / UDP.dnsIssues and PRs related to the dns subsystem.memoryIssues and PRs related to the memory management or memory footprint.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions