http://www.perlmonks.org?node_id=1014175


in reply to Re^4: Timing of garbage collection
in thread Timing of garbage collection

I think that it is fair to say that "mileage varies" even in this simple test....

In a running application, things get more complicated than just "give me a MB" and then immediately I give you back a MB. Over time memory typically becomes more and more fragmented and it becomes more difficult to give back a "useable chunk" of memory...mileage does vary. And this does depend upon the malloc() that is being used. And of course the code.

My original statement was not completely accurate. Sorry about that.

C:perl -E"say `tasklist|find \"$$\"`; $x=chr(0); $x x= 1040352; say ` +tasklist|find \"$$\"`; undef $x; say `tasklist|find \"$$\"`" perl.exe 2208 Console 0 2,556 K perl.exe 2208 Console 0 3,600 K perl.exe 2208 Console 0 2,584 K C:perl -E"say `tasklist|find \"$$\"`; $x=chr(0); $x x= 1040352; say ` +tasklist|find \"$$\"`; undef $x; say `tasklist|find \"$$\"`" perl.exe 576 Console 0 2,552 K perl.exe 576 Console 0 3,592 K perl.exe 576 Console 0 2,576 K C:perl -E"say `tasklist|find \"$$\"`; $x=chr(0); $x x= 1040352; say ` +tasklist|find \"$$\"`; undef $x; say `tasklist|find \"$$\"`" perl.exe 5712 Console 0 2,556 K perl.exe 5712 Console 0 3,600 K perl.exe 5712 Console 0 2,584 K C:perl -E"say `tasklist|find \"$$\"`; $x=chr(0); $x x= 1040352; say ` +tasklist|find \"$$\"`; undef $x; say `ta sklist|find \"$$\"`" perl.exe 5468 Console 0 2,552 K perl.exe 5468 Console 0 3,596 K perl.exe 5468 Console 0 2,580 K