It's possible that you're encountering the practical limits of using flat files and in-memory hashes. Perhaps its time for a database approach. With a proper (and simple) database and some redesign of how you're doing things, you would never need to hold all users in memory at the same time, and wouldn't have to worry about running out of memory, even as the user list grows.
Without seeing actual code, it's difficult to give any more specific tips, but in general, when you start running out of memory it's time to reconsider your design philosophy. Often this means taking that step into the world of databases.
The DBI module, and DBD::SQLite can help to ease the pain of such a transition.
Update: Corrected typo where DBD::SQLite was referred to as DBM::SQLite
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.