in reply to Re: Timing of garbage collection
in thread Timing of garbage collection
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Timing of garbage collection
by Marshall (Canon) on Jan 19, 2013 at 05:07 UTC | |
by zwon (Abbot) on Jan 19, 2013 at 06:00 UTC | |
by flexvault (Monsignor) on Jan 19, 2013 at 15:08 UTC | |
by BrowserUk (Patriarch) on Jan 19, 2013 at 05:21 UTC | |
by Marshall (Canon) on Jan 19, 2013 at 06:40 UTC | |
by BrowserUk (Patriarch) on Jan 19, 2013 at 17:21 UTC | |
by Marshall (Canon) on Jul 06, 2013 at 04:58 UTC |