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

Memleak in AsyncHttpServer with arc/orc #16154

Closed
ba0f3 opened this issue Nov 27, 2020 · 6 comments
Closed

Memleak in AsyncHttpServer with arc/orc #16154

ba0f3 opened this issue Nov 27, 2020 · 6 comments

Comments

@ba0f3
Copy link
Contributor

ba0f3 commented Nov 27, 2020

Im stress testing AsyncHttpServer with orc/arc, the memory keep growing till program get killed due to out of memory. Tested on 1.2.8, 1.4.0 and dev branch

Example

import asynchttpserver, asyncdispatch

proc cb(req: Request) {.async.} =
  await req.respond(Http200, "Hello World")

var server = newAsyncHttpServer()
waitFor server.serve(Port(8080), cb)
# compile
nim c -r -d:release --gc:orc test.nim
# stresstest with `wrk
wrk -t 5 -c 1k  http://127.0.0.1:8080
@disruptek
Copy link
Contributor

Can you give it a shot on the tonightly?

@Araq
Copy link
Member

Araq commented Nov 27, 2020

Tested programs like these for months now, works for me. Which OS are you on?

@ba0f3
Copy link
Contributor Author

ba0f3 commented Nov 27, 2020

I'm using Linux, a debian based distro

@ba0f3
Copy link
Contributor Author

ba0f3 commented Nov 27, 2020

here is the video how it happens on my computer: video

# nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2020-11-27
Copyright (c) 2006-2020 by Andreas Rumpf

git hash: 86662109ecfaec9430e4b98043c479202094f33a
active boot switches: -d:release

@Araq
Copy link
Member

Araq commented Nov 27, 2020

Can reproduce now. Strange but ok.

@Araq
Copy link
Member

Araq commented Nov 27, 2020

Note: Windows is not affected, must be selector seq callback handling once again.

Araq added a commit that referenced this issue Nov 27, 2020
@Araq Araq closed this as completed in c9a10bb Nov 27, 2020
narimiran pushed a commit that referenced this issue Nov 27, 2020
…e addressed in a follow-up PR (#16161)

(cherry picked from commit c9a10bb)
mildred pushed a commit to mildred/Nim that referenced this issue Jan 11, 2021
ardek66 pushed a commit to ardek66/Nim that referenced this issue Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants