-
Notifications
You must be signed in to change notification settings - Fork 18k
net: failed connect/accept leaks memory associated to runtime.PollDesc #5219
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
Labels
Milestone
Comments
I guess it wouldn't be a problem in real use cases at server side but not at intermediaries, issue #2449 might come back again probably. |
I guess it wouldn't be a problem in real use cases at server side but not at intermediaries, issue #2349 might come back again probably. |
The problem would be unnecessary memory consumption because runtime.pollcache keeps consuming memory for runtime.PollDesc when it requires. We should feed descriptors to the pollcache either clean ones from the kernel or the spent ones by calling pollClose. src/pkg/runtime/netpoll.goc: static PollDesc* allocPollDesc(void) { PollDesc *pd; uint32 i, n; runtime·lock(&pollcache); if(pollcache.first == nil) { n = PageSize/sizeof(*pd); if(n == 0) n = 1; // Must be in non-GC memory because can be referenced // only from epoll/kqueue internals. pd = runtime·SysAlloc(n*sizeof(*pd)); for(i = 0; i < n; i++) { pd[i].link = pollcache.first; pollcache.first = &pd[i]; } } pd = pollcache.first; pollcache.first = pd->link; runtime·unlock(&pollcache); return pd; } |
This issue was closed by revision e13341e. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: