On Thu, 26 Feb 2026 10:25:04 GMT, Jaikiran Pai <[email protected]> wrote:

> Can I please get a review of this change which addresses an issue in the 
> `java.naming` module? 
> 
> As noted in https://bugs.openjdk.org/browse/JDK-8273874 when a 
> `javax.naming.Context` is constructed backed by a 
> `com.sun.jndi.ldap.LdapCtxFactory`, the internal implemenation of `LdapCtx` 
> can lead to creation of Threads that are used for the managing connections 
> and for managing event notifications. These threads are system threads. 
> However, the way they are created currently, they end up capturing the 
> context classloader of the calling Thread. This classloader will be held onto 
> as long as these Threads stay alive and can thus prevent the classloader from 
> being unreferenced.
> 
> The change in this PR replaces the creation of these threads with the 
> `InnocuousThread`s, which do not have a context classloader associated with 
> them.
> 
> A new jtreg test has been introduced to reproduce the issue and verify the 
> fix. Existing tests continue to pass with this change.

This pull request has now been integrated.

Changeset: 66a34be5
Author:    Jaikiran Pai <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/66a34be54a43c110f8dd577775fc213ed912faa7
Stats:     341 lines in 4 files changed: 330 ins; 5 del; 6 mod

8273874: LdapClient can trigger memory leak

Reviewed-by: dfuchs

-------------

PR: https://git.openjdk.org/jdk/pull/29934

Reply via email to