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

udp memory leak #513

Closed
DBarney opened this issue Oct 31, 2014 · 1 comment
Closed

udp memory leak #513

DBarney opened this issue Oct 31, 2014 · 1 comment

Comments

@DBarney
Copy link
Contributor

DBarney commented Oct 31, 2014

received udp packet seem to never be freed.

I can use gigs of memory in a few seconds with this example program:

local dgram = require('dgram')

local one = dgram.createSocket('udp4')
one:bind(2000,"127.0.0.1")

local two = dgram.createSocket('udp4')
two:bind(2001,"127.0.0.1")

local echo = function(sock)
    return function(msg, rinfo)
        collectgarbage()
        sock:send("ping", rinfo.port, rinfo.address, function(err)
            if err then
                p('udp send errored',err)
            end
        end)
    end
end

one:on('message',echo(one))
two:on('message',echo(two))

one:send("ping", 2001, "127.0.0.1", function(err)
    if err then
        p('udp send errored',err)
    end
end)
@rphillips
Copy link
Member

This should be fixed now... Please attempt with the latest master.

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

No branches or pull requests

2 participants