Skip Menu |

This queue is for tickets about the XML-Compile-SOAP CPAN distribution.

Report information
The Basics
Id: 57943
Status: resolved
Priority: 0/
Queue: XML-Compile-SOAP

People
Owner: Nobody in particular
Requestors: bunk [...] novozymes.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.13
Fixed in: 0.72



Subject: Memory leak in XML::Compile::WSDL11
On my system the test program below consumes more and more memory if I run it with XML::Compile::SOAP 2.13 and XML::Compile 1.14, but not if I run it with XML::Compile 0.78 and XML::Compile::SOAP 0.72. Sorry for the big gap in versions, but those are the versions that I have easy access to. With top(1) I can see that this grows to around 650 MB of memory usage when the script finishes when using XML::Compile::SOAP 2.13, but only uses 18 MB and doesn't grow when using XML::Compile::SOAP 0.72. I'm using Ubuntu Karmic (9.10): $ perl -v This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi [...]
Subject: test_wsdl_compile
Download test_wsdl_compile
application/octet-stream 232b

Message body not shown because it is not plain text.

Two things: most importantly, reuse the single WSDL11 object. Secondly, I found a subtile loop in XML::Compile::Cache: if(my $anyelem = $args->{any_element}) { my $code = $anyelem eq 'ATTEMPT' ? sub {$self->_convertAnyTyped(@_)} : $anyelem eq 'SLOPPY' ? sub {$self->_convertAnySloppy(@_)} : $anyelem; + # weaken is needed, because code-refs depend on $self, which blocks + # garbage collection on the whole schema. if(ref $self->{XCC_ropts} eq 'ARRAY') { push @{$self->{XCC_ropts}}, any_element => $code; + weaken $self->{XCC_ropts}[-1]; } else { $self->{XCC_ropts}{any_element} = $code; + weaken $self->{XCC_ropts}{any_element}; } } Thanks for the report.