If this is running via CGI, and not in the mod_perl environment, i would certainly have a series of concerns. Not neccesseray so much memory usage, but mostly load time, especially the population of these 100 or so accesible variables. While that is not a GREAT deal of memory, I have been programming for a long time, and I have never encountered a situation with requirements for that type of environment, especially in one monolithic 3000 line module.

My suggestion to you is:

  1. Take a step back, think to yourself, what does this module actually do?
  2. Think to yourself, am I doing a proper job of abstracting data from logic?
  3. Ask: does all of this data need to be loaded at all times? Or is this the type of thing where I can make 3 or 4 dbm's and tie them at run time, so as to not have to repopulate them all the time?
  4. Do I have so much data, and I foresee this growing and needing more computation, that it really should be in a relational model of some sort?
  5. Does this really need to be 1 3000 line module? or should this be 1 50 line module and a series of modules that inherit the interface and special case?

I think once you've answered those questions, you will know if you have made the right decisions. Realistically, 100 object variables ain't gonna kill you... however that may be the symptoms of a improper design. Make sure you attack the cause, and not the symptoms!

Good luck! and keep asking away...


In reply to RE: Memory usage in Perl. by eduardo
in thread Memory usage in Perl. by Speedfreak

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.