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