hyperium / h2

HTTP 2.0 client & server implementation for Rust.
MIT License
1.34k stars 269 forks source link

Mem leak when releasing stream #631

Open LYF1999 opened 1 year ago

LYF1999 commented 1 year ago

https://github.com/hyperium/h2/blob/756384f4cdd62bce3af7aa53a156ba2cc557b5ec/src/proto/streams/counts.rs#L164-L168

There may still leave some bytes releated to the stream in https://github.com/hyperium/h2/blob/756384f4cdd62bce3af7aa53a156ba2cc557b5ec/src/proto/streams/recv.rs#L52 when Counts remove a closed Stream. This may cause mem leak, Should we remove bytes releated to the stream in remove function?

LYF1999 commented 1 year ago

I am gald to submit a PR to fix that, but we can not access Recv in Counts. if we do that, it will be a large change commit.

Millione commented 1 year ago

@seanmonstar can we have a look?

seanmonstar commented 1 year ago

Sure!