"be consistent" | |
PerlMonks |
tuning hash memory usageby jmason (Novice) |
on Nov 20, 2000 at 19:03 UTC ( [id://42496]=perlquestion: print w/replies, xml ) | Need Help?? |
jmason has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I'm running into a wee memory problem. Basically I'm working on a perl project, webmake, which, keeping it simple, does the following: it maintains a list of content items (think files), does all manner of substitutions on them, and writes them to an output directory. It also tracks their dependency graphs so it knows what to rebuild next time around. This is modelled as a hash containing instances of a Content class; each of these contains a member containing the filename (string), and another hash, mapping dependency filenames (string) to a modification date (integer). The problem is, when it runs with a 5000-file data set, it's taking up a hefty chunk of RAM; at peak it hits about 50megs. I think the 5000 instances of the latter hash is a big part of this. Typically a Content item contains 1 dependency. Is there any way, or any alternative Tie:: implementation, that can handle a 1-element hash in a minimum amount of RAM?
Back to
Seekers of Perl Wisdom
|
|