WMS cascading reader can "leak" native memory and bring to OOM

Description

This is not a classic leak, in that GC might eventually fix it, but if there is not enough memory pressure to trigger GC, we can have the following:

  • The server declares GZIP support and we enable it
    * We make requests using gzip and we get back compressed stream
    * We create a GZipInputStream, which uses a Deflater, which allocates native memory
    * Even if we close the http response, we fail to close that stream (so the http stream gets closed, but the gzip one does not)

See here for a description of the leak:
http://www.devguli.com/blog/eng/java-deflater-and-outofmemoryerror/ - http://www.devguli.com/blog/eng/java-deflater-and-outofmemoryerror/)

Environment

None

Status

Assignee

Unassigned

Reporter

Jody Garnett

Triage

None

Components

Fix versions

Priority

Medium
Configure