[jboss-jira] [JBoss JIRA] (WFLY-6801) EJBClientContext leak: EJBClientContext is not unregistered from TCCLEJBClientContextSelectorService when it's closed

liang cheng (JIRA) issues at jboss.org
Mon Jul 4 22:09:00 EDT 2016


     [ https://issues.jboss.org/browse/WFLY-6801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

liang cheng updated WFLY-6801:
------------------------------
    Steps to Reproduce: 
After debugging wildfly source code, I realize the the reproduce steps are very simple. After running following standalone code, you can check the JVM, there are 10 EJBClientContext instances in the heap and could not be GC.
 
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
public class EJBClientContextLeakTest {
    public static void main(String[] args) throws Exception {
        for (int i = 0; i < 10; i++) {
            Properties props = new Properties();
            props.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
            props.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS","JBOSS-LOCAL-USER");
            props.put("jboss.naming.client.ejb.context", true);
            props.put("org.jboss.ejb.client.scoped.context", true);
            props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
            props.put(Context.PROVIDER_URL, "http-remoting://localhost:8080");
            props.put(Context.SECURITY_PRINCIPAL, "myuser");
            props.put(Context.SECURITY_CREDENTIALS, "mypassword");
            InitialContext context = new InitialContext(props);
            context.close();
       }
    }
}



  was:
After debugging wildfly source code, I realize the the reproduce steps are very simple. After running following standalone code, you can check the JVM, there are 10 EJBClientContext instances in the heap and could not be GC.
 
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
public class EJBClientContextLeakTest {
    public static void main(String[] args) throws Exception {
        for (int i = 0; i < 10; i++) {
            Properties props = new Properties();
            props.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
            props.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS","JBOSS-LOCAL-USER");
            props.put("jboss.naming.client.ejb.context", true);
            props.put("org.jboss.ejb.client.scoped.context", true);
            props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
            props.put(Context.PROVIDER_URL, "http-remoting://localhost:8080");
            props.put(Context.SECURITY_PRINCIPAL, "vtbaadmin");
            props.put(Context.SECURITY_CREDENTIALS, "vitria");
            InitialContext context = new InitialContext(props);
            context.close();
       }
    }
}





> EJBClientContext leak: EJBClientContext is not unregistered from TCCLEJBClientContextSelectorService when it's closed
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-6801
>                 URL: https://issues.jboss.org/browse/WFLY-6801
>             Project: WildFly
>          Issue Type: Bug
>          Components: EJB
>    Affects Versions: 9.0.2.Final
>         Environment: one standalone wildfly on windows7
>            Reporter: liang cheng
>              Labels: EJBClientContext, naming
>             Fix For: 9.x.x TBD
>
>
> After running our code with several days, we found there are many EJbClientContext instances are cached in the heap and could not be GC. And cause the memory leak issue.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list