http://qs321.pair.com?node_id=439828


in reply to Space Efficiency of Hashes

This all depends on how much you are exactly storing in your hash tables, but this code should give you a hint, just run it and watch top or some other resource monitor:
#!perl -w use strict; $|=1; my (%a,%b,%c); for (0 .. 500_000) { # set higher if you dare $a{$_} = "x" x 60; # 60 character string $b{$_} = "x" x 60; $c{$_} = "x" x 60; print "\rrow $_" unless $_ % 10000; }

note: this goes up to 190 mb for about 500_000 iterations on my machine YMMV.