in reply to free 0x010400!

When lexicals are destroyed, their space isn't free()d (their value isn't reset either, but that is just to be lazy). This goes along with Perl's general theory of sacrificing memory for speed.

I believe that you can already override this by simply using undef on your lexical. No need for some fancy module.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
(redmist) Re: (tye) Re: free 0x010400!
by redmist (Deacon) on Jan 24, 2001 at 03:18 UTC
    I read some node (sorry, no URL) earlier today in which, it stated that when you undef a variable, it does free up space, but it frees it to perl, not to the OS. This means that in the snippet:
    my $foo = "I drank too much Dew."; undef $foo; my $bar = "I drank too much Dew.";
    Perl will allocate to $bar the memory that $foo took up prior to $foo's undef'ing (or Moral Equivalent).

    redmist
    Silicon Cowboy
    redmist::webnode

    OK, I am a silly goober. Apparently free does NOT give memory back to the OS. It just throws it back n the heap. There goes *that* idea.