Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Mojo::IOLoop::Stream memory hog #1256
Steps to reproduce the behavior
This has the problem that if e.g. a temporary network stall happens, large buffers are created that use up lots of memory, which perl never gets around to reusing even after the buffers are flushed.
Once the underlying
Because currently it doesn't get
It is important to actually
Here, the buffer itself is still using a million bytes of RAM (the LEN field)
The old buffer has been returned to the malloc pool, and a new one created at only 10 bytes long.
added a commit
Sep 7, 2018
Yeah, testing this kind of thing is always rather tricky. But the code looks to be doing the right thing on a visual inspection at least.
I can deploy it and see how it behaves, though due to the rare nature of the problem in practice it may be a while before it turns up again.