Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: memory issues

by Anonymous Monk
on Jan 28, 2013 at 09:08 UTC ( #1015647=note: print w/replies, xml ) Need Help??

in reply to memory issues

Why is this happening?

You wrote it that way, you're storing that much data in memory


$ perl -MDevel::Size=:all -le " @F = 1 .. (5 * 30 * 1024 ); @F{@F}=@F +; print total_size($_) for \@F, \%F " 6758436 13225503

5 files, 30k lines each, stored in hash, and stored in array, 6.5MiB and 13MiB respectively ( 19.5MiB combined)

You actually store three times as much data, mostly duplicated

The solution, store less data, store data on disk, get a better system, or lift ulimits on your account

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015647]
[davido]: Lol, in composing test code for Re: Stupid, yet simple, sort question I managed to fill up /tmp for a moment, causing bash to complain about "pmbash: cannot create temp file for here-document: No space left on device"
[davido]: hm, sorry, wrong link: Re^3: Perl Program to efficiently process 500000 small files in a Directory (AIX) should be it.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2018-03-18 06:55 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (228 votes). Check out past polls.