Create tied hashes for caching that information so that I don't have to hit the database everytime I need the id of some frequenly used term.
And you're wondering why your memory usage is increasing? Why don't you try a run with caching disabled and see if that fixes your problem.
| [reply] |
That's why I tied them to DB_File--I can watch those files grow as the program runs, but there're only 4 of them and they only grow to only about 30MB each.
| [reply] |
Create tied hashes for caching that information so that I don't have to hit the database everytime I need the id of some frequenly used term.
Did you benchmark this? Repeatedly asking the database for the same thing might not be so bad if your database is good in caching. But tied hashes in Perl are slow. There are many factors involved, and what's best will vary from setup to setup, but don't dismiss something for tied hashes too easily if it's performance you care about.
Of course, this has nothing to do with your memory problem.
| [reply] |
| [reply] |