axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <luciano.fiande...@ecb.int>
Subject RE: Axis 1.1 Memory leaks
Date Mon, 23 Feb 2004 19:00:53 GMT
I actually found a solution to the memory inefficiency problem.
It is kind of tricky, so this mail will be a little verbose...

1)
*Original* interface exposed as webservice:
	public String doSomething(ExecutionArgumentTO to) { ... }

where ExecutionArgumentTO is a pojo exposing an attribute
	private String myDocument
	public getMyDocument ...
	public setMyDocument ...

plus other informations related to the document (ok, the pojo is much more complex than this,
but this is
for sake of simplicity).
If the document to set was very big (more than 2Mb), axis was failing with an OutOfMemoryError
on the server side.
It means that the envelope was correctly sent, but axis had problem to parse and extract the
document.
This issue was taking place using both style "document" or "rpc".
Using this approach the produced document (the envelope), was incorporating my document *inside*
the envelope body.

2)
*New* interface exposed as webservice:
	public String doSomething(ExecutionArgumentTO to) { ... }

where ExecutionArgumentTO is a pojo exposing an attribute
	private javax.activation.DataHandler myDocument
	public getMyDocument ...
	public setMyDocument ...

As you can see, the only difference reside in having changed the type of the document. Using
the 
DataHandler object as wrapper for a document, produce a different message. The document, infact,
is
external to the soap message. I have something like this:

<soapenv:Envelope ... >
 <soapenv:Body>
	
    <mydocument href="cid:437D716EBC3F696DECEB3A5CFE4EB5B4"/>
    <databaseId xsi:nil="true"/>
    <fileName>blah blah</datasetFileName>

</soapenv:Body>
</soapenv:Envelope>
------=_Part_0_12621140.1077561773549 
Content-Type: application/octet-stream 
Content-Transfer-Encoding: binary 
Content-Id: <437D716EBC3F696DECEB3A5CFE4EB5B4>
.......the 2.8 MB documents....

In other words, using DataHandler as type does the magic to automatically use attachments
istead of embedded xml.
The generated message is, infact, equal to the one generated using the /samples/attachments
directory.

I hope it makes sense :),
Luciano


-----Original Message-----
From: Nelson Minar [mailto:nelson@monkey.org]
Sent: Monday 23 February 2004 19:44
To: axis-user@ws.apache.org
Subject: RE: Axis 1.1 Memory leaks


>the problem that I'm experiencing is related to some (known?) Axis problem to
>handle large xml documents.

Understood. Does anyone have a simple benchmark that shows how much
memory Axis consumes as a function of the size of the SOAP messages?

>In fact, I'm sending back and forth binary files or large xml files
>(2.5Mb) without using the SAAJ specification or the code used in the
>/sample/attachemnt folder of Axis1.1 distrib.

I suspect you'll find many SOAP environments have a hard time with
this. If you're sending giant data, attachments are likely to be more
efficient. But attachments have interop troubles, and they're not
objects. I'd like to be able to send arrays of 100,000 complex objects
and have them available to my server demarshalled. Barring that, I'd
like to know what the practical limits are.



Any e-mail message from the European Central Bank (ECB) is sent in good faith but shall neither
be binding nor construed as constituting a commitment by the ECB except where provided for
in a written agreement.
This e-mail is intended only for the use of the recipient(s) named above. Any unauthorised
disclosure, use or dissemination, either in whole or in part, is prohibited.
If you have received this e-mail in error, please notify the sender immediately via e-mail
and delete this e-mail from your system.



Mime
View raw message