with all these setups, the server's process consumed 976.2MB of memory,
but when compile it with --gc:orc and the default one everything seems to be okay with a memory usage of 478KB and 4.4MB respectively.
The code is as below:
import jester
settings:
port = Port 9090
routes:
get "/":
resp "Hello World"
runForever()
Tested on:
$ uname -a
Linux iMachine 4.15.0-134-generic #138-Ubuntu SMP Fri Jan 15 10:52:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-01-23
Copyright (c) 2006-2021 by Andreas Rumpf
I've cross-posted to the Nim repo, https://github.com/nim-lang/Nim/issues/16862, and got the clarification, turns out this is a known and expected behavior, not a bug. So, this is closed now.
I've tested a simple "Hello World" and compiled it with these parameters:
then benchmarked it with wrk like this:
with all these setups, the server's process consumed 976.2MB of memory, but when compile it with --gc:orc and the default one everything seems to be okay with a memory usage of 478KB and 4.4MB respectively.
The code is as below:
Tested on: