-
Notifications
You must be signed in to change notification settings - Fork 121
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
Memory usage increases per page load #270
Comments
Have you tried different GCs? Maybe For a simple HTML this definitely shouldn't happen (how much increase do you see?). For larger files I can see that being real as this kind of thing hasn't been tested much and is likely a result of how async streams work in Nim. |
I've tried whatever the default for |
It still happens with the simple html page and |
FYI, i just commented out all the imports except jester and strutils, all my views except the testing index page, and it still occurs. |
More things you can try:
|
@Araq thanks, i tried it with both gc flags you suggested after removing the link to the css file which included the background image. i also removed |
@dom96 this seems to be a jester issue, as i made a simple asynchttpserver-only test serving the same html, and it didn't use more ram per page load. Details in the linked issue above. |
@ITwrx in that case I'd appreciate it if you could grab the jester source and cut down the fat until you find the ram doesn't increase anymore, that way you can find the culprit in Jester :) |
i would like to help, but i'm new to nim and i don't know how qualified i am to help determine what the issue is between asynchttpserver, httpbeast and jester is, at this time. IOW, i'll probably take a look, but i wouldn't hold my breath for a breakthrough. :) |
i just tested the "hello world" example from the jester readme and the mem usage climbs with that too. |
I'm porting my own site/app to Jester and after getting a substantial amount done, i noticed it was using ~800MB of ram. Investigating, i see that every request+response (page load) causes more ram to be used. At first, i noticed this due to the fact that i'm serving videos via html5 video on some pages, and the ram usage goes up quickly, evidently due to #181. Prior to this, i was using httpbeast, but it couldn't serve the videos at all due to #241, so i switched to asynchttpserver.
Now, to try and rule out my code, i'm just testing with a simple route
and serving an html string
and it still uses more ram per page load, just much less than a video page.
Both httpbeast and asynchttpserver exhibit this behaviour, but it's more aggressive with asynchttpserver. I've tried nim 1.0.10, 1.2.8 and 1.4.0 and it happens with each. I'm using Jester 0.5.0 on fedora 32. I think it was happening with 0.4.3 too, IIRC. I'm currently running with:
nim c -d:ssl -d:useStdlib -r ITwrxJester.nim
ssl is needed for smtp in another route.
I tried debugging with the built in profiler and it successfully saved a text file once, but i can't interpret it. Also, that profiler report was from when i was surfing the whole site, not just the index page, if it matters. If you want a profile from just the simplified test, let me know.
https://pastebin.com/P3QX8FQc
I also got a report from valgrind, but i have no experience with that and it makes very little sense to me. Let me know if you want me to attach that, assuming it won't have sensitive info in it (i'm not sure what all is in a typical callgrind.out).
I'm still hoping i'm doing something wrong.
Thanks
The text was updated successfully, but these errors were encountered: