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
02d4e5d1f6
commit
daf61cd294
|
@ -542,9 +542,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