in reply to Re^2: hash function
in thread hash function
Memory usage stayed at about 27 MB (macosx/perl 5.8.6) while the hash was being built and throughout the first sleep, then climbed over 450 MB during the Dump phase. Data::Dumper was making its own internal copies of the keys and values.perl -MDB_File -MData::Dumper -e 'tie %h, "DB_File", "junk.db"; for ($i=0; $i<1_000_000; $i++) { $h{"key_$i"}="value_$i" }; warn "the hash is loaded\n"; sleep 15; warn "starting dump\n"; print Dumper(\%h); warn "the hash has been dumped\n"; sleep 15' > /dev +/null
(The "junk.db" file itself was 47 MB, and a plain-text print out of keys and values as I suggested above would probably be about half that.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: hash function
by chromatic (Archbishop) on Oct 07, 2006 at 19:50 UTC |