I'm writing a piece of code for a customer that forks a copy of itself.
here is the (edited) output of top:
PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
29943 dshahin 0 0 4808 4808 4476 S 0 0.0 1.8 0:00 MIO2
29940 dshahin 0 0 4792 4792 4468 S 0 0.0 1.8 0:00 MIO2
my question is regarding the 'SHARE' column.
Does this mean that additional process only uses 'SIZE - SHARE' kilobytes
of new memory? The customer is concerned (rightly so) about over-utilizing system resources.
They might run many copies simultaneously, will each only eat up 'SIZE - SHARE' k of 'fresh' memory?
I want to be able to tell them there is a 5 meg initial hit, but each new process only uses less than 1meg new memory? Am I lying?:)
A lot of this memory usage is from IO::Socket::SSL, my boss wants me to write it in C to bring down the memory usage,
but it will take much longer and be more prone to errors.
What is a better solution?
Any general memory-saving tips are appreciated.
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.