Hi PerlMonk friends,
I using Strawberry Perl-v5.18.1(MSWin32-x64-multi-thread) on Windows 7 (64bit) for processing some HTML webpages and getting files using FTP and then processing those files.
As these are distinct, sequential activities to be done in this order, I am using 3 threads: 1 for getting & parsing webpage to get list of files, 2nd thread to ftp-get these files (using Perl::FTP) and then 3rd thread to process the downloaded files.
I am creating all these threads in the same perl script which has other functions also.
Thus, according to the behaviour mentioned here "http://www.perlmonks.org/?node_id=288022", I am seeing that my this perl process memory is growing to 190 MB size.
However, if I don't do this with threads, then process memory is close to 50 MB.
I would like to avoid this data copying when the threads are getting created, as it is adding to CPU usage also.
I do not want to use BEGIN, as I want to use command line parameters to decide thread parameters.
Can you please guide me,
If we put each thread in its on package & .pm file, can we avoid or reduce this data copying effect?
What are other possible ways to reduce this to some extent?
Thanks for your time and guidance.
Regards
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.