Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Perl doesn't have "garbage collection" in the sense that it never gives memory back to the OS.

That's demonstrably not exactly true:

C:\test>perl -E"say `tasklist|find \"$$\"`; $x=chr(0); $x x= 2e6; say +`tasklist|find \"$$\"`; undef $x; say `tasklist|find \"$$\"`" perl.exe 139252 Console 1 4 +,660 K perl.exe 139252 Console 1 6 +,680 K perl.exe 139252 Console 1 4 +,724 K

That shows that perl allocating a 2MB scalar and then returning that 2MB back to the OS.

On my Perl/system, the break point for the size of allocations that are released back to the system is 1040351 bytes. anything more and it is; less and it is not:

C:\test>perl -E"say `tasklist|find \"$$\"`; $x=chr(0); $x x= 1040352; +say `tasklist|find \"$$\"`; undef $x; say `tasklist|find \"$$\"`" perl.exe 129340 Console 1 4 +,688 K perl.exe 129340 Console 1 5 +,788 K perl.exe 129340 Console 1 4 +,780 K C:\test>perl -E"say `tasklist|find \"$$\"`; $x=chr(0); $x x= 1040351; +say `tasklist|find \"$$\"`; undef $x; say `tasklist|find \"$$\"`" perl.exe 241476 Console 1 4 +,704 K perl.exe 241476 Console 1 5 +,788 K perl.exe 241476 Console 1 5 +,792 K

That number is a around 8k less than 1MB, so presumably it is 1MB internally but then some is used for internal management.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^2: Timing of garbage collection by BrowserUk
in thread Timing of garbage collection by dd-b

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (5)
    As of 2014-07-26 08:37 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (175 votes), past polls