Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: warning "Out of memory!"

by dasgar (Priest)
on Jan 23, 2014 at 17:44 UTC ( #1071787=note: print w/replies, xml ) Need Help??

in reply to warning "Out of memory!"

I agree with others that your posted code definitely looks like its missing quite bit.

In your code, I see lines like my @genes=<GENES>;, which kind looks like your intent is to store the contents into an array such that each element of the array corresponds to a line in the file.

Don't know if that is the source of your memory issues or not, but if that really is your intent and you want to reduce the memory being used, I would recommend checking out Tie::File. Tie::File will tie a file to an array and each line of the file becomes an element of the array. Also, Tie::File does not read the entire file into memory. It even has an option that you can set to increase/decrease the amount of memory that it "will consume at any time while managing the file".

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1071787]
NodeReaper gets the Vote Fairy drunk

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2018-02-19 16:34 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (266 votes). Check out past polls.