You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Jörg Michelberger (JIRA)" <ji...@apache.org> on 2019/04/04 11:20:00 UTC

[jira] [Updated] (DIRMINA-1103) Avoid sticky byte array buffers in Zlib CompressionFilter

     [ https://issues.apache.org/jira/browse/DIRMINA-1103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Michelberger updated DIRMINA-1103:
---------------------------------------
    Description: 
For each Zlib instance there is a zStream instance which is equipped with new buffers for each in and out of inflate / deflate. This buffers are not released after each inflate / deflate. So the last compressed and uncompressed byte[] and its content for rx and tx is not garbage collectable on each session.

It would be great if there was a reset(zStream) method on Zlib which sets the in and out to static empty byte[] to release these buffers after usage quite before returning from Zlib.deflate and Zlib.inflate. Something like:

{{void reset (zStream) {}}{{            }}

{{  zStream.next_in = EMPTY_BYTE_ARRAY;}}
 {{  zStream.next_in_index = 0;}}
 {{  zStream.avail_in = 0;}}
 {{  zStream.next_out = EMPTY_BYTE_ARRAY;}}
 {{  zStream.next_out_index = 0;}}
 {{  zStream.avail_out = 0;}}

{{}}}

 

  was:
For each Zlib instance there is a zStream instance which is equipped with new buffers for each in and out of inflate / deflate. This buffers are not released after each inflate / deflate. So the last compressed and uncompressed byte[] and its content for rx and tx is not garbage collectable on each session.

It would be great if there was a reset(zStream) method on Zlib which sets the in and out to static empty byte[] to release these buffers after usage quite before returning from Zlib.deflate and Zlib.inflate.

{{reset (zStream) {}}{{            zStream.next_in = EMPTY_BYTE_ARRAY;}}
{{            zStream.next_in_index = 0;}}
{{            zStream.avail_in = 0;}}
{{            zStream.next_out = EMPTY_BYTE_ARRAY;}}
{{            zStream.next_out_index = 0;}}
{{            zStream.avail_out = 0;}}

{{}}}


> Avoid sticky byte array buffers in Zlib CompressionFilter
> ---------------------------------------------------------
>
>                 Key: DIRMINA-1103
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-1103
>             Project: MINA
>          Issue Type: Improvement
>    Affects Versions: 2.0.21
>            Reporter: Jörg Michelberger
>            Priority: Major
>
> For each Zlib instance there is a zStream instance which is equipped with new buffers for each in and out of inflate / deflate. This buffers are not released after each inflate / deflate. So the last compressed and uncompressed byte[] and its content for rx and tx is not garbage collectable on each session.
> It would be great if there was a reset(zStream) method on Zlib which sets the in and out to static empty byte[] to release these buffers after usage quite before returning from Zlib.deflate and Zlib.inflate. Something like:
> {{void reset (zStream) {}}{{            }}
> {{  zStream.next_in = EMPTY_BYTE_ARRAY;}}
>  {{  zStream.next_in_index = 0;}}
>  {{  zStream.avail_in = 0;}}
>  {{  zStream.next_out = EMPTY_BYTE_ARRAY;}}
>  {{  zStream.next_out_index = 0;}}
>  {{  zStream.avail_out = 0;}}
> {{}}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)