how can you tell if your program is a memory hog, or is forking processes unbeknownst?
You can fork processes using fork, system, or open. If you're running code you wrote, I'd expect you to know whether you'd forked anything off, so I'm guessing you're asking about detecting this in code you did not write.
ps axl will show memory information (in VSZ and RSS fields). It also lists every process's parent process ID (in PPID), so for a given Perl program, you can see how much memory it's using, and you can look for other processes spawned from it.
Will using the '-w' directive prevent it?
No, that just warns about possible coding mistakes.
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.