Re: Please help: perl run out of memory

David Emanuel da Costa Santiago <[email protected]>
Newsgroups gmane.comp.lang.perl.beginners
Message-ID <[email protected]>

Às 11:33 de 17/04/22, wilson escreveu:
> hello the experts,
> 
> can you help check my script for how to optimize it?
> currently it was going as "run out of memory".
> 
> $ perl count.pl
> Out of memory!
> Killed
> 
> 
> My script:
> use strict;
> 
> my %hash;
> my %stat;
> 

To be honest you don't need the %stat, however you'll need to go through 
the %hash several times for the average calculation. It will also make 
the script more unreadable.

You can also read the file several times, and on each time extract only 
the values of only one item.

The best option is for you to use a profiler to figure it out where the 
most memory is being consumed...


Good luck.

Regards,
David Santiago

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.