Analyzing a heap dump with leaked SSLSocketImpl
<p>I have an application that runs on Amazon EC2 (using several AWS products such as S3, DynamoDB, etc.) and has a memory leak.  I collected some heap dumps and ran them through Eclipse's Memory Analyzer Tool, which pinpointed several hundred instances of <code>sun.security.ssl.SSLSocketImpl</code> (taking up dozens of MB of memory) as probable leaks.</p>

<p>I'm having trouble however figuring out why these <code>SSLSocketImpl</code> objects haven't been disposed of.</p>

<p>most instances of <code>SSLSocketImpl</code> in the dumps have two references, one from <code>java.lang.ref.Finalizer</code>, and one from <code>com.amazonaws.internal.SdkSSLSocket</code>.  the Finalizer thread in my heap dump is reported as idle, with no objects awaiting finalization.  but the <code>com.amazonaws.internal.SdkSSLSocket</code> objects that have references to the leaked <code>SSLSocketImpl</code> objects seem to have been cleaned up.  at least, I can't find them in the heap dump (Dominator view in MAT).</p>

<p>I'm new to analyzing java heap dumps.  what should I look for next?  if the Amazon <code>SdkSSLSocket</code> objects have indeed been cleaned up, why weren't the <code>SSLSocketImpl</code> objects also cleaned up?</p>

<p>thanks!</p>