First, you need to understand the implications of a persistent Perl interpreter. When Perl loads something into a lexical variable and the lexical goes out of scope, it doesn't release that memory. This is an optimization, assuming you will probably use that variable again. What this means is that if you load a big file into memory (and remember that Perl takes a lot more RAM to store something than it takes on disk), you will permanently add the size of that file to your process.
However, you should not see any growth if you just keep loading the same file over and over again. If that's what you see, then you may have a bug somewhere.
The second thing to understand is that this is probably a bad idea. Why serve a static image from your dynamic script? Why not simply redirect or serve it straight from apache?
If you really must serve the image yourself, look at Apache::File. There's an example of using it in the Eagle book.
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.