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

2419running out of memory while sending large attachment

Expand Messages
  • Guy Incognito <jsd@cluttered.com>
    Feb 26, 2003
    • 0 Attachment
      i'm using a soap service developed by a corporate partner of ours.
      they want us to upload big files (possibly up to 1.5GB) to them
      using this service. i of course wanted to write it using perl
      because i love perl. unfortunately i am having horrible problems
      running out of memory even when uploading relatively small (150M)
      files. the machine in question has 2G of RAM. this line causes the
      memory overflow:

      $kid = $con->uploadFile(
      SOAP::Data->type('Session' => $session),
      SOAP::Data->type('Format' => $Format),
      SOAP::Data->name("source")->attr({href => "cid:$cid"})
      );

      by watching top i can see that the process grows and grows until it
      hits the size of the file + mime base64 encoding overhead, which
      says to me that it has finished uploading. at this point, however,
      it goes berzerk and leaps from, say 385M (for a 280M source file) to
      2G and then the machine thrashes a bit and eventually the perl
      process dies with "Out of memory!"

      uploadFile is defined by this wsdl fragment:

      <wsdl:operation name="uploadFile" parameterOrder="sessionId fo data">
      <wsdl:input message="impl:uploadFileRequest"
      name="uploadFileRequest"/>
      <wsdl:output message="impl:uploadFileResponse"
      name="uploadFileResponse"/>
      </wsdl:operation>

      <wsdl:operation name="uploadFile">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="uploadFileRequest">
      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="http://soap.kontiki.com" use="encoded"/>
      </wsdl:input>
      <wsdl:output name="uploadFileResponse">
      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="http://soap.kontiki.com" use="encoded"/>
      </wsdl:output>
      </wsdl:operation>

      i can provide the full example program on request although it is a
      bit lengthy.

      is there anything obvious i can try? i'm rather new to all of
      this. please don't make me learn java... :)

      -jsd-