SOAP::Lite leaking memory

Jonathan Stowe jns at gellyfish.com
Thu Mar 15 11:36:43 GMT 2007


On Thu, 2007-03-15 at 11:01 +0000, Gareth Harper wrote:
> I have a fairly simple script, which creates a new SOAP::Lite object (2 
> actually, but thats not important), sends 3 calls (login, dosomething, 
> logout), and then SOAP::Lite object goes out of scope and "should" be 
> destroyed.  I was running some soak tests on this last night (repeated 
> calls) and was getting some relatively large memory leaks (the script 
> started off at about 20Mb, and rose to around 100Mb after about 30 
> minutes with a 1 second sleep between).
> 

"going out of scope" is not necessarily going to cause everything to go
away as SOAP::Lite dynamically creates methods in a variety of
namespaces (I'm not going to check right now as the code makes me
uneasy) and it is possible that it is closing over some of the lexical
variables.

> After poking about with Devel:;Symdump and Devel::Leak I'm fairly 
> confident that it is definately SOAP::Lite leaking the memory from 
> somewhere but before I start delving into the depths of SOAP::Lite I 
> wondered if anyone had come across this before and had managed to 
> fix/workaround it (in a worst case scenario I can always fork off the 
> SOAP::Lite process but I'd really rather not do that).

If you are using the "autoloaded" interface (i.e.
$soap->YourMethod(@args) ) you might want to try the explicit call (i.e.
$soap->call('MyMethod', @args) ) as that is possibly going to fiddle
with the symbol table less.

You might also want to test this with just re-using the single
SOAP::Lite object as I seem to recall that most of the horrible stuff
happens in the constructor.

/J\


More information about the london.pm mailing list