You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Oleg Kalnichevski <ol...@apache.org> on 2026/02/14 10:46:23 UTC
Memory leak in H2 protocol handler introduced by Priority support
Hi Arturo
I just realized that we have introduced a memory leak in H2 protocol
handler with the stream priority support.
Why do we have a map that we populate but never ever make any use of?
This makes no sense. Moreover, we never ever clean it up. This is
really bad.
https://github.com/apache/httpcomponents-core/blob/master/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java#L144
Please either find a way to push PriorityValue into H2Streams whose
streams actually get cleaned up once they reach the end of their life
cycle or remove it entirely.
Once again ,we have introduced a feature with no good reason and no
clear use case in mind and now it causes us troubles.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: Memory leak in H2 protocol handler introduced by Priority support
Posted by Arturo Bernal <ab...@apache.org>.
Hi Oleg,
I pushed PriorityValue into H2Stream (lifecycle-bound) and now update it
from PRIORITY_UPDATE / Priority header, removing the separate priority map.
Arturo
On Sat, Feb 14, 2026 at 11:48 AM Oleg Kalnichevski <ol...@apache.org> wrote:
> Hi Arturo
>
> I just realized that we have introduced a memory leak in H2 protocol
> handler with the stream priority support.
>
> Why do we have a map that we populate but never ever make any use of?
> This makes no sense. Moreover, we never ever clean it up. This is
> really bad.
>
>
> https://github.com/apache/httpcomponents-core/blob/master/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java#L144
>
> Please either find a way to push PriorityValue into H2Streams whose
> streams actually get cleaned up once they reach the end of their life
> cycle or remove it entirely.
>
> Once again ,we have introduced a feature with no good reason and no
> clear use case in mind and now it causes us troubles.
>
> Oleg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>