I'm trying to build a version of perl 5.10 that will have as small a memory footprint (both code and data) as possible. I want to run an existing perl application with a small memory budget. The application uses quite a bit of perl and CPAN stuff and typically has a memory footprint in the range 60-120MB on common platforms.
So far I have built perl with the following (possibly relevant) configure arguments:
config_arg18='-Ubincompat5005'
config_arg19='-Ud_dosuid'
config_arg20='-Ui_db'
config_arg21='-Ui_gdbm'
config_arg22='-Ui_ndbm'
config_arg23='-Uuse64bitall'
config_arg24='-Uuse64bitint'
config_arg25='-Uuseithreads'
config_arg26='-Uuselargefiles'
config_arg27='-Uuselongdouble'
config_arg28='-Uusemorebits'
config_arg29='-Uuseshrplib'
config_arg30='-Uusethreads'
Are there any other simple suggestions?
Or not so simple ones? I'd be prepared to go as far as modifying perl internals if it is likely to be useful.
I found the following: oplines - make perl runtime 8% faster and smaller; Does anyone know if this made it into 5.10? I would guess not, given the date of the messages.
Finally (for now) are there any generic tips for perl code to reduce the size of the in-memory (compiled) size? These could be general patterns, or processing techniques that one might apply when building the deployable application.
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.