Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Heapdump analysis showing websocket sessions with java.util.zip.Deflater memory leaks

Hi all,
We are using jetty v9.1.1.20140108.  Recently we were seeing our applications, after some time, reaching near the max memory settings (1.5gb) with frequent garbage collection cycles. After taking heap dumps on these instances, we have noticed many websocket sessions consuming lots of excessive memory using the java.util.zip.Deflator class.  

I know the clients are sending the permessage-deflate extension, so I assume jetty websocket compression is active.  The nature of the websocket traffic between server and client is such that typical payloads to the client are less than 200kb (uncompressed), sent once a minute or so.  The number of active sessions is less than 20.

Based on the bit of googling I have done, recommendations on usage of the Deflater class are to invoke the end method once use is complete in order to allow finalizers to run and avoid memory leaks.  In poking around Jetty source code, I don't see any invocations of this method.  

I'm thinking this may be an unreported bug, perhaps related to the PerMessageDeflateExtension class.  Please advise if you have seen this issue, as well as any recommended fixes or workarounds (which hopefully wouldn't require disabling compression). 

Thanks,
Patrick Dolan

Back to the top