kernelsauce / turbo

Turbo is a framework built for LuaJIT 2 to simplify the task of building fast and scalable network applications. It uses a event-driven, non-blocking, no thread design to deliver excellent performance and minimal footprint to high-load applications while also providing excellent support for embedded uses.
http://turbo.readthedocs.io/
Apache License 2.0
528 stars 84 forks source link

Uploading (post) and garbage collection #252

Closed markuman closed 8 years ago

markuman commented 8 years ago

I want to use Turbolua with a webform to upload files (at onces, no chunked upload).

Here is my main.lua and upload.html: https://gist.github.com/markuman/9f280b11d8eb602ae903

This works, but after uploading several files of medium size, it can be observed that the used memory is growing and growing ... until it hits /usr/local/share/lua/5.1/turbo/structs/buffer.lua:75: No memory. So how to release the memory?

yurayko commented 8 years ago

Try to insert collectgarbage() before self:finish()

kernelsauce commented 8 years ago

Yes. What he said. Basically you are filling up the memory of your device. tor. 10. mar. 2016 kl. 13.53 skrev yurayko notifications@github.com:

Try to insert collectgarbage() before self:finish()

— Reply to this email directly or view it on GitHub https://github.com/kernelsauce/turbo/issues/252#issuecomment-194829726.

Mvh / Best regards John Abrahamsen Tlf/Phone: (+47) 941 35 009

markuman commented 8 years ago

Yes, that works fine. Thx!