Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Strange memory growth?

by pg (Canon)
on Nov 07, 2003 at 21:20 UTC ( [id://305450]=note: print w/replies, xml ) Need Help??


in reply to Re: Strange memory growth?
in thread Strange memory growth?

This is still a bug. Try this:

use strict; use warnings; if (1) { my $a = 100; } print $a;

If you are not allowed to ref that $a any more, once exit that if block, there is absolutely no point not to garbage collect it.

Replies are listed 'Best First'.
Re:x3 Strange memory growth? (or Laziness?)
by grinder (Bishop) on Nov 07, 2003 at 22:53 UTC
    there is absolutely no point not to garbage collect it

    Yes there is. It might be cheaper, (read: Lazier) to not garbage collect it at all, and just let the program fall off the end of the world. Just because you can, doesn't mean it's worth spending the effort to do so.

    It was only with the advent of mod_perl and similar long-running persistent perl processes that any serious effort started to be devoted to keeping track of perl's resource usage. It used to be that it was cheaper not to do anything, because in a few milliseconds time, the pages used by the process would be reclaimed by the OS when program ended anyway.

    And given perl's propensity for trading off memory for speed, it doesn't really surprise me that we see the behaviour demonstrated by the OP.

Re: Re: Re: Strange memory growth?
by mce (Curate) on Nov 10, 2003 at 10:10 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://305450]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 03:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found