jmason has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: tuning hash memory usage
by lhoward (Vicar) on Nov 20, 2000 at 19:57 UTC | |
|
Re: tuning hash memory usage
by gaspodethewonderdog (Monk) on Nov 20, 2000 at 23:36 UTC | |
by jmason (Novice) on Nov 21, 2000 at 23:45 UTC | |
|
Re: tuning hash memory usage
by Dominus (Parson) on Nov 20, 2000 at 20:08 UTC | |
by jmason (Novice) on Nov 21, 2000 at 23:44 UTC | |
|
Re: tuning hash memory usage
by tedv (Pilgrim) on Nov 21, 2000 at 00:44 UTC | |
|
Re: tuning hash memory usage
by dws (Chancellor) on Nov 21, 2000 at 09:16 UTC | |
by jmason (Novice) on Nov 21, 2000 at 23:33 UTC |