Closed samfrown closed 1 month ago
I have a heap dump but it's bigger than allowed attachment size :(
@samfrown please send heap dump at: sbordet ~at~ webtide.com.
@samfrown please send heap dump at: sbordet ~at~ webtide.com.
sent by gmail
@samfrown just to be sure I understand, you are bombing the server with 1 health check every 100 ms?
What is your configuration (if you have specified one) for the SSLSession cache size and SSLSession timeout? I see from the dump respectively 1000 and 86400 seconds, looks like you changed the default for the cache size?
If we make a PR where we do not store the SslSessionData
in the SSLSession
, would you be able to try it out?
Right, it were just HAP health checks (for that particular dump). And, yes, I tried to change cache size and session timeout with -Djavax.net.ssl.sessionTimeout=600 -Djavax.net.ssl.sessionCacheSize=1000.
If we make a PR where we do not store the SslSessionData in the SSLSession, would you be able to try it out?
Yes, I will.
Just FTR, the SSLSession cache has always been a problem not only for Jetty but for Java in general.
The behavior you see is normal: SSLSession instances are wrapped into SoftReferences, and only when you run low on heap they will be cleared. This mechanism is in Java itself and we cannot do anything about.
Having said that, try this PR: #12288.
Having said that, try this PR: https://github.com/jetty/jetty.project/pull/12288.
Hi. I sent the dump from PR version by mail. It looks much better.
See also #4923 for context.
Jetty version(s) 12.0.13 (all >12.0.3)
Jetty Environment core
Java version/vendor
(use: java -version)
JVM: OpenJDK 64-Bit Server VM (21+35-LTS, mixed mode, sharing) Java: version 21 2023-09-19 LTS, vendor Amazon.com Inc.OS type/version Rocky Linux 8/Docker
Description We noticed the issue when the heap usage of a jetty-based service with TLS port was increasing constantly until the max limit. The gathered heap dump shows a lot of SSLSessionImpl objects (more that ssl session cache size limit). All of the "swollen" sessions are sourced from HAProxies.
Later the same situation was reproduced with just one HAProxy as a client which:
The Eclipse MAT reports the following:
The SSLSessionImpl objects seems retained under the soft referenced session cache entries and are cleaned up finally when heap reaches the max memory limit. But still this excessive heap consumption looks suspicious.
Also the issue isn't reproduced with Jetty 12.0.3. Before 12.0.3 ssl session data was hold inside the request (SecurityRequestCustomizer). Later the org.eclipse.jetty.io.EndPoint$SslSessionData was introduced to hold the data inside the SSLSession itself, which may be cause the issue.
How to reproduce?
To mitigate the issue
Either: