Hi Eily . thank you for such a detailed answer!

Actually, I wrote the two script with the fork.pl call another crawler.pl .The two script memory will keep increasing, I suspect I wrote the script with some problem, the reference count not zero, so the memory is not released.

$fork, I placed in sub Config, $fork=$json_conf->{'fork'}, I set up 500 in the conf.json file.

undef, I tried to release the memory, really no effect !

Two while (1): are a crawler script, the first while (1), I let it keep running. While the second while (1), because I found that sometimes get error (it seems that SSL error or other things what I forget) the script will be directly out.So I have a idea with eval, it can work, although it is not perfect, let me change it again :)

You suggest to changed script to modules, whether should also solved memory surge problem ,so that it will have effect ?

I would like to use the Devel:: Peek module, but 5.20.3 version can not install, I do not know how to analyze the problem of memory surge, please help me to check Thanks a lot!


In reply to Re^2: Memory has been increasing, unable to release memory. by Perl_Love
in thread Memory has been increasing, unable to release memory. by Perl_Love

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.