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.