JDK-8218626 : LdapContext#reconnect() leads to a memory leak and open network connect
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.naming
  • Affected Version: 11.0.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86_64
  • Submitted: 2019-02-07
  • Updated: 2019-02-07
  • Resolved: 2019-02-07
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE PROBLEM :
With the commit http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/021b47694183 the behavior of the method LdapCtx#reconnect() has changed. Previously, a call to LdapCtx#reconnect did not affect the current LdapClient. The change made in this commit creates a new LdapClient each time LdapCtx#reconnect is called. Because of the worker thread of the LDAP connection the former LdapClient remains alive and will never garbage collected.

If I understand the code correctly, the former LdapClient should be closed in LdapCtx#connect(boolean) by calling closeConnection(false) when we try to reconnect.

REGRESSION : Last worked in version 8u201


FREQUENCY : always