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

4995Returning "::" causes out of memory error on Windows XP under ASPerl 5.6.1 B633

Expand Messages
  • chesal
    Nov 7, 2005
    • 0 Attachment
      I have a script that gathers a bunch of data as an array from an
      Apache server running a SOAP::Lite interface, serializes it and
      returns it.

      On Linux and under Cygwin the approximatly 300kB of data is returned,
      parsed and printed by the script with barely any memory use at all.

      But the script, run ActiveState Perl 5.6.1 B633, ends up running out
      of memory. Memory use climbs to 2GB and soon after the script enters
      the sub:

      SOAP::Lite::deserialize()

      Specifically the line:

      my $parsed = $self->decode($_[0]);

      The memory usage quickly climbs to 2GB and then the script dies as it
      hits the upper bound on user memory in Windows XP. On Linux or under
      Cygwin this script runs fine. Barely a blip in memory usage.

      The data is an array of strings where each string matches the form:

      (\d+)::(\d+)::(\S+)::(.*)\n

      The "::" is used as a field separator for some data. The data is
      returned as a scalar from the SOAP server by saying:

      return join("", @data);

      The data is then deserialized on the script side with:

      my @data = split(/\n/, $result->result());

      I went with the scalar translation in an attempt to fix the memory
      problem but whether I return @data or join("", @data) I get the same
      result -- out of memory on Windows XP.

      BUT if I change the strings in @data to:

      (\d+)\s+(\d+)\s+(\S+)\s+(.*)\n

      Then the problem goes away. The SOAP::Lite::deserialization() sub is
      fast and accounts for barely a blip on the memory monitor.

      Does anyone know what it is with "::" that causes the deserializer
      such problem under Windows?

      - Ian
    • Show all 4 messages in this topic