SSLSocketImpl leak heap analysis

I have an application that runs on Amazon EC2 (using multiple AWS products like S3, DynamoDB, etc.) and has a memory leak. I collected several heap heaps and ran them through the Eclipse Memory Analyzer Tool, which detected several hundred instances of sun.security.ssl.SSLSocketImpl (occupying tens of MB of memory) as possible leaks.

I am having problems, however, figuring out why these SSLSocketImpl objects SSLSocketImpl not deleted.

most SSLSocketImpl instances in dumps have two links: one from java.lang.ref.Finalizer and one from com.amazonaws.internal.SdkSSLSocket . The Finalizer thread in my heap dump is reported as unoccupied, with no objects awaiting completion. but com.amazonaws.internal.SdkSSLSocket objects referencing missing SSLSocketImpl objects seem to have been cleared. at least I cannot find them in a heap dump (Dominator representation in MAT).

I am new to java heap dump analysis. What should I look for next? if Amazon SdkSSLSocket objects really were SdkSSLSocket , why weren't SSLSocketImpl objects SSLSocketImpl as well?

thanks!

+7
source share
1 answer

Perhaps this is due to the fact that the SSL session cache size is not set, which is infinite by default and can end up consuming a huge amount of heap. Setting javax.net.ssl.sessionCacheSize = 1000 should help.

+1
source

Source: https://habr.com/ru/post/1012946/


All Articles