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

Abnormal Memory usage while sending attachments

Expand Messages
  • Chetan Lalye
    Hi I m using the following code to test attachments.Everything works as expected and I can save the attachment on the server side but during the invocation,
    Message 1 of 3 , Jan 29, 2004
    • 0 Attachment
      Hi
       
      I'm using the following  code to test attachments.Everything works as expected and I can save the attachment on the server side but during the invocation, the memory usage of the perl process shoots upto 600 MB !!  The attachment file is only 30 MB.
       
      Any ideas whats wrong. looks like this could be a bug.
       
      thanks
      Chetan 
       
      P.S - I'm using Windows XP
       
      my $ent = build MIME::Entity
        'Type'        => "application/zip",
      #  'Encoding'    => "base64",
        'Path'        => "E:\\users\\chetan\\att1.zip",
        'Disposition' => "attachment";
       
      my $result =  SOAP::Lite
          ->readable(1)
          ->uri($uri)
          ->proxy($proxy)
              ->parts($ent)
              ->testAttach(SOAP::Data->name("username" => $name));                    
    • Randy J. Ray
      ... Unfortunately, the problem is less with SOAP::Lite than with LWP, the package that SOAP::Lite uses for HTTP transport. Unless a message is assembled in a
      Message 2 of 3 , Jan 29, 2004
      • 0 Attachment
        Chetan Lalye wrote:
        > Hi
        >
        > I'm using the following code to test attachments.Everything works as
        > expected and I can save the attachment on the server side but during the
        > invocation, the memory usage of the perl process shoots upto 600 MB !!
        > The attachment file is only 30 MB.

        Unfortunately, the problem is less with SOAP::Lite than with LWP, the package
        that SOAP::Lite uses for HTTP transport. Unless a message is assembled in a
        particular way, HTTP::Request and LWP::UserAgent end up creating the entire
        message as an in-memory string, and if there is any redirection or
        authentication done in the communications, there could be multiple copies
        created on the Perl interpreter's heap. It's very likely that SOAP::Lite
        compounds the issue with it's own object memory requirements, since a lot of
        values have to be created in the process of producing the final message.

        There's not really anything that can be done about this, at least not for now.

        Randy
        --
        rjray@... http://www.rjray.org http://www.svsm.org

        Always code as if the guy who ends up maintaining your code will be a violent
        psychopath who knows where you live. -- Rick Osborne
      • Byrne Reese
        Thanks for the thoughtful reply. This issue is being tracked in the bud database, and I will see what I can negotiate with the LWP maintainers. As for
        Message 3 of 3 , Jan 29, 2004
        • 0 Attachment
          Thanks for the thoughtful reply. This issue is being tracked in the bud
          database, and I will see what I can negotiate with the LWP maintainers. As
          for SOAP::Lite, we should do what we can to address stuff there as best we
          can.

          >
          >
          >
          >
          > Chetan Lalye wrote:
          > < Hi
          > <
          > < I'm using the following code to test attachments.Everything works as
          > < expected and I can save the attachment on the server side but during the
          > < invocation, the memory usage of the perl process shoots upto 600 MB !!
          > < The attachment file is only 30 MB.
          >
          > Unfortunately, the problem is less with SOAP::Lite than with LWP, the
          > package
          > that SOAP::Lite uses for HTTP transport. Unless a message is assembled in
          > a
          > particular way, HTTP::Request and LWP::UserAgent end up creating the
          > entire
          > message as an in-memory string, and if there is any redirection or
          > authentication done in the communications, there could be multiple copies
          > created on the Perl interpreter's heap. It's very likely that SOAP::Lite
          > compounds the issue with it's own object memory requirements, since a lot
          > of
          > values have to be created in the process of producing the final message.
          >
          > There's not really anything that can be done about this, at least not for
          > now.
          >
          > Randy
          > --
          > rjray@... http://www.rjray.org
          > http://www.svsm.org
          >
          > Always code as if the guy who ends up maintaining your code will be a
          > violent
          > psychopath who knows where you live. -- Rick Osborne
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          > Yahoo! Groups Sponsor
          >
          >
          > ADVERTISEMENT
          >
          >
          >
          >
          >
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          > To visit your group on the web, go
          > to:http://groups.yahoo.com/group/soaplite/
          > To unsubscribe from this group, send an email
          > to:soaplite-unsubscribe@yahoogroups.com
          > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
          >
          >
          >
          >
          >
          >
          >


          ^byrne :/
        Your message has been successfully submitted and would be delivered to recipients shortly.