Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] client daemon increasing memory

Expand Messages
  • Duncan Cameron
    ... Sorry, that is getting beyond my knowledge. As a workaround can you look at re-using the S::L object each time, rather than creating a new one? I would
    Message 1 of 5 , Nov 10, 2004
    • 0 Attachment
      On 2004-11-10 at 22:17:27 zperlcoder wrote:

      >Duncan,
      >
      >I used Devel::Leak::Object to check whether the $soap object was
      >destroyed at the end of the run....here is the code I used:
      >
      > my $i = 0;
      > while($i < 2){
      > {
      > my $LocationCode = SOAP::Data->name('LocationCode')
      > ->type('string')
      > -
      >>value("location_code")
      > -
      >>uri("http://blabla/");
      > my $soap = new SOAP::Lite;
      > Devel::Leak::Object::track($soap);
      >
      > $soap->proxy("http://blabla/blabla.asmx")
      > -> uri("http://blabla/")
      > -> on_action(sub{join '', @_});
      >
      > my $response = eval { $soap->MachineList($LocationCode) };
      > if($@){
      > print "ERROR: $@\n";
      > }
      > if($response->fault){
      > print "ERROR: " . $response->faultstring ."\n";
      > }else{
      > print "Success\n";
      > }
      > }
      > $i++;
      > }
      >
      > the result is:
      >-----------------------------------------------------------------------
      >----------------------
      >Status of all classes:
      >SOAP::Lite 2
      >
      >so turning on the SOAP::Lite +trace shows me that in my while loop I
      >keep on creating new SOAP::Lite objects and none of them are destroyed
      >until the loop ends when the code exits.
      >
      >Is there an explicit destroy or exit method that I could call to force
      >the object to disappear?

      Sorry, that is getting beyond my knowledge. As a workaround can you
      look at re-using the S::L object each time, rather than creating a new
      one? I would guess that the object is reusable by calling the proxy()
      and uri() methods again.

      Duncan
    Your message has been successfully submitted and would be delivered to recipients shortly.