You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Charith Dhanushka Wickramarachchi (Created) (JIRA)" <ji...@apache.org> on 2011/11/28 10:28:40 UTC

[jira] [Created] (AXIS2-5203) JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.

JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.
-----------------------------------------------------------------------------

                 Key: AXIS2-5203
                 URL: https://issues.apache.org/jira/browse/AXIS2-5203
             Project: Axis2
          Issue Type: Improvement
          Components: jaxws
         Environment: any
            Reporter: Charith Dhanushka Wickramarachchi
            Priority: Critical


In Current JAX-WS Message Receiver its adds a new URL class Loader instance as TCCL for each request. This becomes a major performance hit as it cause to create XMLOutputFactory at Axiom level for each response from the server.

And also this may cause OOM situation since at AXIOM level it cache the XMLOutput factories per class Loader by default. So in this case the Hash map entries that's used for this  cache will get accumulated.

thanks,
Charith 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5203) JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.

Posted by "Andreas Veithen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159167#comment-13159167 ] 

Andreas Veithen commented on AXIS2-5203:
----------------------------------------

Basically, your analysis is limited to the fact that JAXWSMessageReceiver creates a _new_ class loader for every request (and therefore your logical conclusion is to cache that class loader), while I would go a step further and say that  the very fact that it creates a class loader and the way it creates it are problematic. If I get the time tonight I will try to construct an argument that clearly shows that the original code which creates this class loader is incorrect.
                
> JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-5203
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5203
>             Project: Axis2
>          Issue Type: Improvement
>          Components: jaxws
>         Environment: any
>            Reporter: Charith Dhanushka Wickramarachchi
>            Priority: Critical
>         Attachments: AXIS2-5203.diff
>
>
> In Current JAX-WS Message Receiver its adds a new URL class Loader instance as TCCL for each request. This becomes a major performance hit as it cause to create XMLOutputFactory at Axiom level for each response from the server.
> And also this may cause OOM situation since at AXIOM level it cache the XMLOutput factories per class Loader by default. So in this case the Hash map entries that's used for this  cache will get accumulated.
> thanks,
> Charith 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5203) JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.

Posted by "Andreas Veithen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13158732#comment-13158732 ] 

Andreas Veithen commented on AXIS2-5203:
----------------------------------------

My 2 cents: to me the original code (introduced by AXIS2-4930) looks totally broken and the patch proposed here doesn't really make this better; I think we should reevaluate AXIS2-4930 and see if there is a better solution for the original issue.
                
> JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-5203
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5203
>             Project: Axis2
>          Issue Type: Improvement
>          Components: jaxws
>         Environment: any
>            Reporter: Charith Dhanushka Wickramarachchi
>            Priority: Critical
>         Attachments: AXIS2-5203.diff
>
>
> In Current JAX-WS Message Receiver its adds a new URL class Loader instance as TCCL for each request. This becomes a major performance hit as it cause to create XMLOutputFactory at Axiom level for each response from the server.
> And also this may cause OOM situation since at AXIOM level it cache the XMLOutput factories per class Loader by default. So in this case the Hash map entries that's used for this  cache will get accumulated.
> thanks,
> Charith 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Resolved] (AXIS2-5203) JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.

Posted by "Charith Dhanushka Wickramarachchi (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charith Dhanushka Wickramarachchi resolved AXIS2-5203.
------------------------------------------------------

    Resolution: Won't Fix

Thanks Andreas for the nice analysis. As AXIS2-4930 is fixed. I m marking this issue as resoled.  
                
> JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-5203
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5203
>             Project: Axis2
>          Issue Type: Improvement
>          Components: jaxws
>         Environment: any
>            Reporter: Charith Dhanushka Wickramarachchi
>            Priority: Critical
>         Attachments: AXIS2-5203.diff
>
>
> In Current JAX-WS Message Receiver its adds a new URL class Loader instance as TCCL for each request. This becomes a major performance hit as it cause to create XMLOutputFactory at Axiom level for each response from the server.
> And also this may cause OOM situation since at AXIOM level it cache the XMLOutput factories per class Loader by default. So in this case the Hash map entries that's used for this  cache will get accumulated.
> thanks,
> Charith 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Updated] (AXIS2-5203) JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.

Posted by "Charith Dhanushka Wickramarachchi (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charith Dhanushka Wickramarachchi updated AXIS2-5203:
-----------------------------------------------------

    Attachment: AXIS2-5203.diff

Patch to resolve this issue. With this patch JAXWS MessageReceiver  will cache CLs per service. 

Please review and commit. 
                
> JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-5203
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5203
>             Project: Axis2
>          Issue Type: Improvement
>          Components: jaxws
>         Environment: any
>            Reporter: Charith Dhanushka Wickramarachchi
>            Priority: Critical
>         Attachments: AXIS2-5203.diff
>
>
> In Current JAX-WS Message Receiver its adds a new URL class Loader instance as TCCL for each request. This becomes a major performance hit as it cause to create XMLOutputFactory at Axiom level for each response from the server.
> And also this may cause OOM situation since at AXIOM level it cache the XMLOutput factories per class Loader by default. So in this case the Hash map entries that's used for this  cache will get accumulated.
> thanks,
> Charith 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5203) JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.

Posted by "Amila Chinthaka Suriarachchi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13158605#comment-13158605 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-5203:
-----------------------------------------------------

Nice catch.

Your patch make it use same class loader with different thread contexts. Which may not be a good practice.

please look at how setThreadContext method in org.apache.axis2.receivers.AbstractMessageReceiver handles that restoring the old class loader after invocation.

Can you try with that and please see whether this problem occurs when we set 

<parameter name="ServiceTCCL">composite</parameter> for normal axis2 services (According to that code this should not happen).

Please send a mail to dev list showing profile images before an after your improvement.

                
> JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-5203
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5203
>             Project: Axis2
>          Issue Type: Improvement
>          Components: jaxws
>         Environment: any
>            Reporter: Charith Dhanushka Wickramarachchi
>            Priority: Critical
>         Attachments: AXIS2-5203.diff
>
>
> In Current JAX-WS Message Receiver its adds a new URL class Loader instance as TCCL for each request. This becomes a major performance hit as it cause to create XMLOutputFactory at Axiom level for each response from the server.
> And also this may cause OOM situation since at AXIOM level it cache the XMLOutput factories per class Loader by default. So in this case the Hash map entries that's used for this  cache will get accumulated.
> thanks,
> Charith 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5203) JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.

Posted by "Charith Dhanushka Wickramarachchi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159214#comment-13159214 ] 

Charith Dhanushka Wickramarachchi commented on AXIS2-5203:
----------------------------------------------------------

Hi Amila ,

I tried this scenario with normal Axis2 services with and without parameter <parameter name="ServiceTCCL">composite</parameter> And in both cases this issue does not exist for them. I can see TCCL remains same for all requests. 

thanks,
Charith
                
> JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-5203
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5203
>             Project: Axis2
>          Issue Type: Improvement
>          Components: jaxws
>         Environment: any
>            Reporter: Charith Dhanushka Wickramarachchi
>            Priority: Critical
>         Attachments: AXIS2-5203.diff
>
>
> In Current JAX-WS Message Receiver its adds a new URL class Loader instance as TCCL for each request. This becomes a major performance hit as it cause to create XMLOutputFactory at Axiom level for each response from the server.
> And also this may cause OOM situation since at AXIOM level it cache the XMLOutput factories per class Loader by default. So in this case the Hash map entries that's used for this  cache will get accumulated.
> thanks,
> Charith 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5203) JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.

Posted by "Andreas Veithen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159534#comment-13159534 ] 

Andreas Veithen commented on AXIS2-5203:
----------------------------------------

I've updated AXIS2-4930 with an analysis of the reasons why the original code is incorrect.
                
> JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-5203
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5203
>             Project: Axis2
>          Issue Type: Improvement
>          Components: jaxws
>         Environment: any
>            Reporter: Charith Dhanushka Wickramarachchi
>            Priority: Critical
>         Attachments: AXIS2-5203.diff
>
>
> In Current JAX-WS Message Receiver its adds a new URL class Loader instance as TCCL for each request. This becomes a major performance hit as it cause to create XMLOutputFactory at Axiom level for each response from the server.
> And also this may cause OOM situation since at AXIOM level it cache the XMLOutput factories per class Loader by default. So in this case the Hash map entries that's used for this  cache will get accumulated.
> thanks,
> Charith 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5203) JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.

Posted by "Charith Dhanushka Wickramarachchi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159070#comment-13159070 ] 

Charith Dhanushka Wickramarachchi commented on AXIS2-5203:
----------------------------------------------------------

Hi Andreas, 

Can you please Elaborate on your statement a little bit as it is not clear to me ? (Basically your comment does not give any clear reasoning for your clams) 

Let me clarify what i have done. 

In Axiom (StaXUtils) it keeps a cache of XMLOutputFactories in a map per CL where it is in this case TCCL. and by default caching is enabled. So i think idea was to avoid creation of  XMLOutputFactory per each request which is a costly operation. (I'll start a mail thread on this and post the profile data i have.).


But in current JAXWSMessageReceiver it creates and adds a new CL and set it as TCCL per each request which cases Axiom to create a new XMLOutputFactory per each request. And as they are cached this may cause OOM.

So in this case i m going to avoid this by using the same class loader per service.May be we can discuss and improve the patch. 


@Amila 
I'll will look at how normal services behave and see whether this issue is there in that services too and keep this thread posted. 

thanks,
Charith



                
> JAX-WS Message Receiver Adds a new URL class loader to TCCL per each request.
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-5203
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5203
>             Project: Axis2
>          Issue Type: Improvement
>          Components: jaxws
>         Environment: any
>            Reporter: Charith Dhanushka Wickramarachchi
>            Priority: Critical
>         Attachments: AXIS2-5203.diff
>
>
> In Current JAX-WS Message Receiver its adds a new URL class Loader instance as TCCL for each request. This becomes a major performance hit as it cause to create XMLOutputFactory at Axiom level for each response from the server.
> And also this may cause OOM situation since at AXIOM level it cache the XMLOutput factories per class Loader by default. So in this case the Hash map entries that's used for this  cache will get accumulated.
> thanks,
> Charith 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org