diff --git a/actix-ws/src/stream.rs b/actix-ws/src/stream.rs index 27a3cdff9..aff4163ac 100644 --- a/actix-ws/src/stream.rs +++ b/actix-ws/src/stream.rs @@ -140,6 +140,10 @@ impl Stream for StreamingBody { return Poll::Ready(None); } + // When we have a moment (pending) allow the BigBytes to release memory + // arbitrary 8KB (page size) + this.buf.clear(1024 * 8); + Poll::Pending } }