develooper Front page | perl.perl5.porters | Postings from November 2009

memory problem of "eval" in perl 5.10?

Thread Next
From:
christian4perl
Date:
November 26, 2009 11:54
Subject:
memory problem of "eval" in perl 5.10?
Message ID:
200911262054.49138.christian4perl@lists.muthpartners.de
Hello,

We have a problem with the eval of the "new" perl 5.10.

Before, a brief background. We have run several applications which were 
developed with design patterns, especially the state machine. In 
conjunction with a data flow logic, analogous to the Unix filter. Perl’s 
internal state of the state machine will be dumped at the end of every 
"step" (Data:: Dumper), and stored in flat files or database CLOB 
columns. Later, these dumps are reread, evaluated and then the work on 
the data will continue.

Now it seems, that the "eval" from perl 5.10 are partially being very 
rude with the available memory resources. It gives a mismatch of 1:1000; 
every byte to be evaluated, needs 1Kbyte main memory. That means, the 
data which could be processed with perl 5.8.8, with perl 5.10.0 creates 
an "out of memory" (just as all makable 5.9.*). For reproducing tests, 
the script eval.pl attached. The offender (eval) is on line 65.

The function memory () and expandSI () are to determine the memory 
consumption, as it sees the operating system (it works under linux 
only). So that eval.pl has something to do, we also attached the support 
script get.pl. It loads eight outer space images from the Internet and 
creates files with the changed Data::Dumper HTTP::Response instances 
(lines 72-75 of get.pl).

We presume that the evaluation has a caching mechanism. Because a 
functional evaluation repeats often; no new memory is required. Even two 
different evaluations are possible repeatedly, therefore there is enough 
space for everyone alone.

However, most of our application steps evaluate smaller structures. It 
never takes a long time. The computer will interactively be tough and 
will relatively quickly get the application from linux as an "out of 
memory".

Can you help us?

(a) Is there an error in the procedure? Although the applications run 
under perl 5.6 and 5.8 for many of years.

(b) Does it require different "parameters" of the modules or compiling 
it?

(c) How can we find a solution to our problem.

Sincerely



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About