Fix memory leak in GzipHandler (#1429)
Looks like this leak shows itself only with asynchronous responses. Some relevant info: http://www.devguli.com/blog/eng/java-deflater-and-outofmemoryerror/ Signed-off-by: Denis Nedelyaev <denvned@gmail.com>
This commit is contained in:
parent
c366934d30
commit
724c5b7da3
|
@ -610,9 +610,13 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory
|
|||
@Override
|
||||
public void recycle(Deflater deflater)
|
||||
{
|
||||
deflater.reset();
|
||||
if (_deflater.get()==null)
|
||||
{
|
||||
deflater.reset();
|
||||
_deflater.set(deflater);
|
||||
}
|
||||
else
|
||||
deflater.end();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
|
Loading…
Reference in New Issue