agrafix / Spock

Another Haskell web framework for rapid development
https://www.spock.li
679 stars 56 forks source link

Spock session memory problem. #139

Closed huseyinyilmaz closed 6 years ago

huseyinyilmaz commented 6 years ago

It seems like spock session has a memory footprint that gets larger overtime.

Here is where this issue is originated from: https://www.reddit.com/r/haskell/comments/81cbmt/help_for_a_space_leak/

To test I created this: https://github.com/huseyinyilmaz/spock-memmory-usage-test/blob/master/spockmemtest/app/Main.hs

It is simpler version of spock template on stack.

I ran the project and than I used wrk to create stress test it:

$ wrk http://localhost:8080/hello/huseyin -d 2m

After running this test couple times server was using 1560MB memory.

My main problem is I do not need DB or Session. I was just using spock for view related utilities like json function. I think it would be nice to be able to disable session from configuration.

Other than that this is a really nice project. Thank you for your work.

huseyinyilmaz commented 6 years ago

Hello, I replace spock with wai and I am still having the same problem. So I suspect that this might be a problem with wai or warp. I opened another issue about it here:

https://github.com/yesodweb/wai/issues/676

agrafix commented 6 years ago

This was fixed in warp