in reply to System out of memory while storing huge amount of data
I just faced the same problem. With a few lines, I moved my ~4GB hash from RAM to disc:
use DB_File; my $db = '/path/to/hash.db'; my %hash; tie (%hash, "DB_File", $db, $DB_BTREE) or die("Unable to tie $db: $!") +; # do things with hash untie %hash;
Note that $DB_BTREE format is a lot faster than the default, $DB_HASH. (Twice as fast, in my benchmarks.) See also 152966, and the thread leading up to it.
|
|---|