You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Holger Sunke (JIRA)" <ji...@apache.org> on 2012/10/01 09:01:08 UTC

[jira] [Created] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Holger Sunke created CXF-4529:
---------------------------------

             Summary: PermGen Leak for CXFAuthenticator (WS Client Configuration)
                 Key: CXF-4529
                 URL: https://issues.apache.org/jira/browse/CXF-4529
             Project: CXF
          Issue Type: Bug
          Components: Configuration, JAX-WS Runtime
    Affects Versions: 2.6.1
         Environment: Apache Tomcat 7, Windows 7 32bit
            Reporter: Holger Sunke


Hello,

seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
The prevents the GC from collecting the WebappClassLoader on hot undeployment.

I helped myself by doing 

java.net.Authenticator.setDefault(null);

on contextDestroy().

Our web application uses CXF as a jasWS client.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Posted by "Danielius Jurna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476776#comment-13476776 ] 

Danielius Jurna edited comment on CXF-4529 at 10/16/12 6:02 AM:
----------------------------------------------------------------

This is defenitely a classloader leak. CXFAuthenticator is loaded by webapp classloader and reference of this object is set to java system class, which is loaded by system classloader. So when application is unloaded, webapp classloader cannot be garbage collected, because CXFAuthenticator is referenced from java.net.Authenticator. This creates PermGen leak.
This issue must be reopened.
                
      was (Author: jurna):
    This is defenitely a classloader leak. CXFAuthenticator is loaded by webapp classloader and reference of this object is set to java system class, which is loaded by system classloader. So when application is unloaded, webapp classloadee cannot be garbage collected, because CXFAuthenticator is referenced from java.net.Authenticator. This creates PermGen leak.
This issue must be reopened.
                  
> PermGen Leak for CXFAuthenticator (WS Client Configuration)
> -----------------------------------------------------------
>
>                 Key: CXF-4529
>                 URL: https://issues.apache.org/jira/browse/CXF-4529
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, JAX-WS Runtime
>    Affects Versions: 2.6.1
>         Environment: Apache Tomcat 7, Windows 7 32bit
>            Reporter: Holger Sunke
>            Assignee: Freeman Fang
>              Labels: leak, permgen
>
> Hello,
> seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
> This prevents the GC from collecting the WebappClassLoader on hot undeployment.
> I helped myself by doing 
> java.net.Authenticator.setDefault(null);
> on contextDestroy().
> Our web application uses CXF as a jasWS client configured with Spring 3.0.5.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473999#comment-13473999 ] 

Freeman Fang commented on CXF-4529:
-----------------------------------

Hi,

In my option it's not a memory leak,  per the code in
java.net.Authenticator
// The system-wide authenticator object.  See setDefault().
    private static Authenticator theAuthenticator;
It's system-wide object, so it's intended behavior to not gc, and this code is out of CXF code base, CXF can't change this behavior.
BTW, when you use 
java.net.Authenticator.setDefault(null);
it cause system-wide effect so it may affect other module which need use this  theAuthenticator.

Anyway, it shouldn't be a CXF issue

Freeman
                
> PermGen Leak for CXFAuthenticator (WS Client Configuration)
> -----------------------------------------------------------
>
>                 Key: CXF-4529
>                 URL: https://issues.apache.org/jira/browse/CXF-4529
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, JAX-WS Runtime
>    Affects Versions: 2.6.1
>         Environment: Apache Tomcat 7, Windows 7 32bit
>            Reporter: Holger Sunke
>              Labels: leak, permgen
>
> Hello,
> seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
> This prevents the GC from collecting the WebappClassLoader on hot undeployment.
> I helped myself by doing 
> java.net.Authenticator.setDefault(null);
> on contextDestroy().
> Our web application uses CXF as a jasWS client configured with Spring 3.0.5.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Posted by "Holger Sunke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Holger Sunke updated CXF-4529:
------------------------------

    Description: 
Hello,

seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
This prevents the GC from collecting the WebappClassLoader on hot undeployment.

I helped myself by doing 

java.net.Authenticator.setDefault(null);

on contextDestroy().

Our web application uses CXF as a jasWS client.

  was:
Hello,

seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
The prevents the GC from collecting the WebappClassLoader on hot undeployment.

I helped myself by doing 

java.net.Authenticator.setDefault(null);

on contextDestroy().

Our web application uses CXF as a jasWS client.

    
> PermGen Leak for CXFAuthenticator (WS Client Configuration)
> -----------------------------------------------------------
>
>                 Key: CXF-4529
>                 URL: https://issues.apache.org/jira/browse/CXF-4529
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, JAX-WS Runtime
>    Affects Versions: 2.6.1
>         Environment: Apache Tomcat 7, Windows 7 32bit
>            Reporter: Holger Sunke
>              Labels: leak, permgen
>
> Hello,
> seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
> This prevents the GC from collecting the WebappClassLoader on hot undeployment.
> I helped myself by doing 
> java.net.Authenticator.setDefault(null);
> on contextDestroy().
> Our web application uses CXF as a jasWS client.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang reassigned CXF-4529:
---------------------------------

    Assignee: Freeman Fang
    
> PermGen Leak for CXFAuthenticator (WS Client Configuration)
> -----------------------------------------------------------
>
>                 Key: CXF-4529
>                 URL: https://issues.apache.org/jira/browse/CXF-4529
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, JAX-WS Runtime
>    Affects Versions: 2.6.1
>         Environment: Apache Tomcat 7, Windows 7 32bit
>            Reporter: Holger Sunke
>            Assignee: Freeman Fang
>              Labels: leak, permgen
>
> Hello,
> seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
> This prevents the GC from collecting the WebappClassLoader on hot undeployment.
> I helped myself by doing 
> java.net.Authenticator.setDefault(null);
> on contextDestroy().
> Our web application uses CXF as a jasWS client configured with Spring 3.0.5.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Posted by "Danielius Jurna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476776#comment-13476776 ] 

Danielius Jurna commented on CXF-4529:
--------------------------------------

This is defenitely a classloader leak. CXFAuthenticator is loaded by webapp classloader and reference of this object is set to java system class, which is loaded by system classloader. So when application is unloaded, webapp classloadee cannot be garbage collected, because CXFAuthenticator is referenced from java.net.Authenticator. This creates PermGen leak.
This issue must be reopened.
                
> PermGen Leak for CXFAuthenticator (WS Client Configuration)
> -----------------------------------------------------------
>
>                 Key: CXF-4529
>                 URL: https://issues.apache.org/jira/browse/CXF-4529
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, JAX-WS Runtime
>    Affects Versions: 2.6.1
>         Environment: Apache Tomcat 7, Windows 7 32bit
>            Reporter: Holger Sunke
>            Assignee: Freeman Fang
>              Labels: leak, permgen
>
> Hello,
> seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
> This prevents the GC from collecting the WebappClassLoader on hot undeployment.
> I helped myself by doing 
> java.net.Authenticator.setDefault(null);
> on contextDestroy().
> Our web application uses CXF as a jasWS client configured with Spring 3.0.5.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang resolved CXF-4529.
-------------------------------

    Resolution: Not A Problem
    
> PermGen Leak for CXFAuthenticator (WS Client Configuration)
> -----------------------------------------------------------
>
>                 Key: CXF-4529
>                 URL: https://issues.apache.org/jira/browse/CXF-4529
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, JAX-WS Runtime
>    Affects Versions: 2.6.1
>         Environment: Apache Tomcat 7, Windows 7 32bit
>            Reporter: Holger Sunke
>            Assignee: Freeman Fang
>              Labels: leak, permgen
>
> Hello,
> seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
> This prevents the GC from collecting the WebappClassLoader on hot undeployment.
> I helped myself by doing 
> java.net.Authenticator.setDefault(null);
> on contextDestroy().
> Our web application uses CXF as a jasWS client configured with Spring 3.0.5.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Posted by "Petr Nídl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498659#comment-13498659 ] 

Petr Nídl commented on CXF-4529:
--------------------------------

And there is another problem related to this one. When you have two (or more) applications deployed to application server, each of them using CXFAuthenticator, and you stop one of them, the alive one will fail to proceed with authentication task because the still registered CXFAuthenticator fails to load its necessary classes because is classloader is already marked as stopped. On Tomcat this looks like this:
{code}
Nov 15, 2012 9:24:19 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already.  Could not load org.apache.cxf.message.MessageImpl.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException

	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1597)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
	at org.apache.cxf.endpoint.ClientImpl.getConduit(ClientImpl.java:835)
	at org.apache.cxf.endpoint.ClientImpl.destroy(ClientImpl.java:206)
	at org.apache.cxf.frontend.ClientProxy.finalize(ClientProxy.java:94)
	at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
	at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
	at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
{code}
But I suppose that this problem really is unresolvable and the solution is to use Commons HTTPClient for HTTP Conduit (CXF-291)
                
> PermGen Leak for CXFAuthenticator (WS Client Configuration)
> -----------------------------------------------------------
>
>                 Key: CXF-4529
>                 URL: https://issues.apache.org/jira/browse/CXF-4529
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, JAX-WS Runtime
>    Affects Versions: 2.6.1
>         Environment: Apache Tomcat 7, Windows 7 32bit
>            Reporter: Holger Sunke
>            Assignee: Freeman Fang
>              Labels: leak, permgen
>
> Hello,
> seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
> This prevents the GC from collecting the WebappClassLoader on hot undeployment.
> I helped myself by doing 
> java.net.Authenticator.setDefault(null);
> on contextDestroy().
> Our web application uses CXF as a jasWS client configured with Spring 3.0.5.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Posted by "Holger Sunke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Holger Sunke updated CXF-4529:
------------------------------

    Description: 
Hello,

seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
This prevents the GC from collecting the WebappClassLoader on hot undeployment.

I helped myself by doing 

java.net.Authenticator.setDefault(null);

on contextDestroy().

Our web application uses CXF as a jasWS client configured with Spring 3.0.5.

  was:
Hello,

seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
This prevents the GC from collecting the WebappClassLoader on hot undeployment.

I helped myself by doing 

java.net.Authenticator.setDefault(null);

on contextDestroy().

Our web application uses CXF as a jasWS client.

    
> PermGen Leak for CXFAuthenticator (WS Client Configuration)
> -----------------------------------------------------------
>
>                 Key: CXF-4529
>                 URL: https://issues.apache.org/jira/browse/CXF-4529
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, JAX-WS Runtime
>    Affects Versions: 2.6.1
>         Environment: Apache Tomcat 7, Windows 7 32bit
>            Reporter: Holger Sunke
>              Labels: leak, permgen
>
> Hello,
> seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
> This prevents the GC from collecting the WebappClassLoader on hot undeployment.
> I helped myself by doing 
> java.net.Authenticator.setDefault(null);
> on contextDestroy().
> Our web application uses CXF as a jasWS client configured with Spring 3.0.5.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4529) PermGen Leak for CXFAuthenticator (WS Client Configuration)

Posted by "Petr Nídl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13481426#comment-13481426 ] 

Petr Nídl commented on CXF-4529:
--------------------------------

I agree with Danielius. This is definitely a classloader leak. Although it is caused by design of java.net.Authenticator class the problem comes from CXF that either should not rely on java.net.Authenticator or should come with solution that allows its correct cleanup. Also the workaround mentioned by Freeman (java.net.Authenticator.setDefault(null)) will not work correctly because it can wipe out all authenticators possibly registered by other (still running) applications.
                
> PermGen Leak for CXFAuthenticator (WS Client Configuration)
> -----------------------------------------------------------
>
>                 Key: CXF-4529
>                 URL: https://issues.apache.org/jira/browse/CXF-4529
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, JAX-WS Runtime
>    Affects Versions: 2.6.1
>         Environment: Apache Tomcat 7, Windows 7 32bit
>            Reporter: Holger Sunke
>            Assignee: Freeman Fang
>              Labels: leak, permgen
>
> Hello,
> seemes to me there is a memory leak with the CXFAuthenticator. There is a static reference to it in java.net.Authenticator.theAuthenticator .
> This prevents the GC from collecting the WebappClassLoader on hot undeployment.
> I helped myself by doing 
> java.net.Authenticator.setDefault(null);
> on contextDestroy().
> Our web application uses CXF as a jasWS client configured with Spring 3.0.5.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira