Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Eating RAM problem

by Cine (Friar)
on Aug 01, 2002 at 18:13 UTC ( [id://186874]=note: print w/replies, xml ) Need Help??


in reply to Eating RAM problem

sub test_loop_4 { ####### Uses a lot less RAM, but still a lot, because there are 2mil + elems in @all2... ####### A wild guess would be about 20-25*filesize in ramusage open(FILE, $file) or die $!; my $buf = ''; my @all2 = (); while(read FILE,$buf,1) { push @all2,$buf; } }


T I M T O W T D I

Replies are listed 'Best First'.
Re: Re: Eating RAM problem
by TheFifthDeuce (Novice) on Aug 01, 2002 at 18:47 UTC
    Thanks Cine, but your example still uses 120 MB of RAM. With everybodies input, I now realize WHY RAM is being eaten alive.lol I gotta work on a buffer-scheme or multiple reads/writes from the file. Anybody comes up with anything, please post!

    Thanks,
    David
      It is quite difficult to come up with a caching scheme for a usage pattern that is unknown ;)
      I suggest you make a new question where you state what you need.

      T I M T O W T D I

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://186874]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-23 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found