-
Notifications
You must be signed in to change notification settings - Fork 222
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
out_buffer grows until allocation fails #291
Comments
The issue appears to be the allocation strategy in Printing |
Digging deeper, the buffer is often reallocated in I've patched this locally with this commit, which
Happy to PR this if you want; until then, I've changed my build to point to the forked repo. |
I've been using
ws-rs
in an application which passes images from an embedded device to a webpage, as a simple video streaming solution.On very rare occasions, the system suffers from memory exhaustion, prints something like
memory allocation of 268447744 bytes failed
and crashes.
I've managed to trigger this situation and catch it in the debugger. The issue appears to be
out_buffer
growing without bounds. Here's a full backtrace:I tried to limit the size of
out_buffer
by configuringout_buffer_grow: false, out_buffer_capacity: 1310720
in theBuilder
settings. The debugger confirms that these settings have been applied.However,
out_buffer
has still grown to a much larger size than expected:Specifically,
cap: 167772160
is much larger than the fixed capacity of1310720
.Digging into the source, it seems like the only place this buffer is touched is
check_out_buffer
. Do you have any ideas why the buffer could be growing large enough to trigger allocation failures?The text was updated successfully, but these errors were encountered: