Recently, We upgraded one of our service to Java11. We are running the service in Kubernetes. After this upgrade, we started facing restarts because of Kernel OOMKiller.
On debugging, We found Deflator was taking much of the off-heap memory.
All calls to our service have Accept-Encoding set to gzip. When we looked into GzipResponseStream, we observed GzipOutputStream(this uses Deflater which allocates native memory) is never closed
|
public void close() throws IOException { |
Not closing GzipOutputStream has lead to native memory in other libraries too - https://issues.apache.org/jira/browse/CURATOR-354
@decebals Is there any reason why close() in GzipResponseStream doesn't call GzipOutputStream's close()?
Recently, We upgraded one of our service to Java11. We are running the service in Kubernetes. After this upgrade, we started facing restarts because of Kernel OOMKiller.
On debugging, We found Deflator was taking much of the off-heap memory.
All calls to our service have
Accept-Encodingset togzip. When we looked into GzipResponseStream, we observed GzipOutputStream(this uses Deflater which allocates native memory) is never closedpippo/pippo-core/src/main/java/ro/pippo/core/gzip/GZipResponseStream.java
Line 45 in a6ab828
Not closing GzipOutputStream has lead to native memory in other libraries too - https://issues.apache.org/jira/browse/CURATOR-354
@decebals Is there any reason why
close()in GzipResponseStream doesn't callGzipOutputStream's close()?