On 7/17/07, Ann Robinson <[EMAIL PROTECTED]> wrote:

The Out-Of-Memory (OOM) error happens on a server with a large number of
applications.  At deployment time, when the applications are loaded, the
AxisService objects are created. For those applications where the loading
ends up invoking the WSDL11ToAxisServiceBuilder, the wsdl is read in and
saved as a Parameter on the AxisService object.  So, the OOM happens before
requests start flowing.

I tried a solution where the WSDLDefinition object is saved via
serialization, so that it could be re-loaded when needed after deployment
time. The javax.wsdl.Definition interface is supposed to implement the
java.io.Serializable interface. However, the WSDLDefinition object fails
to serialize. I speculate that the WSDLDefinition implementation has some
internal tables or structures that don't support the default java
serialization.

I tried another solution with a wrapper on the WSDLDefinition object.  The
wrapper, which is transparent to the user of the WSDLDefinition object,
releases the heavyweight portions of the WSDLDefinition object.  If a
component accesses the WSDLDefinition via the Parameter from the AxisService
object, the wrapper can reload the WSDLDefinition.  This solution resolved
the OOM problem - the server was able to load and start the applications
successfully, and handle requests.

Did you tried the ?wsdl for wsdls having
1. imported wsdl in it
2. imported and included schemas on it
3. inline schemas on it
with useOriginalWSDL parameter set to true?

And wsdl2java generated code for above senarios?


I will create a patch with this solution so that it can be reviewed.

Ok. Please send a note to this thread as well.


Ann


On 07/16/2007 11:25 PM, *"Amila Suriarachchi" <[EMAIL PROTECTED]
>* wrote:

 > On 7/16/07, *Sanjiva Weerawarana* <[EMAIL PROTECTED]<[EMAIL PROTECTED]>>
wrote:
 > This is used for when useOriginalWSDL is true right?

yes.


   > I think the best thing is option (a) and have some policy for
   taking it out of the server
   > and re-loading it if it hasn't been hit for a while.
   >
   > I'm very much against option (c)- that's overkill for this problem
   IMO.
   >
   > In any case, why is it leading to an OOM error? The WSDL should be
   read
   > once and then hung onto ... so unless the number of services is
   growing
   > arbitrarily large there's really no reason for the memory usage to
   grow.
   > I'm not convinced this is the reason for the OOM (unless for some
   reason
   > we keep creating new Definitions and never release the old one).


yes.  this should not cause any OOM errors unless we load wsdl definition
object per request. (then that is clearly an Axis2 bug). Ann are you getting
the error at request processing time or deployment time?

if it is at request processing time then we should creating wsdl
definition objects per request and that should be an axis2 bug. What we
supposed to do is to keep the original wsdl definition object and serialize
it when user requested. But Here I think we can check for useOriginalWsdl
parameter before storing that in memory to improve performance.

if it is at deployment time none of above solutions would not solve the
problem. Since we have to create the wsdlDefinition object at least once to
create the axis object structure.

thanks,
Amila.

   >>  On 15/07/07, Ann Robinson <[EMAIL PROTECTED]<[EMAIL PROTECTED]>>
   wrote:
   >>  >
   >>  >
   >>  > Hi, all,
   >>  >  I've been investigating an out-of-memory error that happens
   on the server
   >>  > in some environments.  In analyzing the java heap dumps, one
   of the biggest
   >>  > consumers of memory is with the wsdl4j WSDLDefinition objects.
    The heap
   >>  > dump indicates that the WSDLDefinition uses the xerces dom for
   underlying
   >>  > support, particularly for schemas.  This makes the
   WSDLDefinition very
   >>  > heavy-weight.
   >>  >
   >>  >  The heap dump also shows that the WSDLDefinition objects of
   concern are the
   >>  > ones being saved in the AxisService's ParameterInclude list.
    Comments in
   >>  > the code (WSDL11ToAxisServiceBuilder) indicate that this is
   done so that, if
   >>  > some component needs to utilize the WSDLDefinition, the
   component can access
   >>  > it via a Parameter in the AxisService.
   >>  >
   >>  >  Is it possible to reduce the utilization of the
   WSDLDefinition?
   >>  >  Some ideas are:
   >>  >  (a) releasing it when it is no longer needed
   >>  >           - this might not be possible to determine
   >>  >
   >>  >  (b) putting a wrapper on the WSDLDefinition object
   >>  >           - so that the WSDLDefinition,or a portion of the
   WSDLDefinition,
   >>  >             can be released
   >>  >           - but if the WSDLDefinition is accessed after it was
   released
   >>  >             the wrapper can reload the WSDLDefinition
   transparently to
   >>  >             user
   >>  >
   >>  >  (c) create a layer for caching wsdl-related information
   >>  >           - this would allow for releasing memory based on
   some algorithm
   >>  >             and/or interface that could indicate what's no
   longer needed
   >>  >
   >>  >  Ann




--
Amila Suriarachchi,
WSO2 Inc.

Reply via email to