Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Does undef free ram?

by Elian (Parson)
on Jul 17, 2002 at 15:20 UTC ( [id://182455]=note: print w/replies, xml ) Need Help??


in reply to Does undef free ram?

Yes, undef is the best way to completely release the memory that an array uses. That memory will be available for reallocation in your program. The memory will not, unless the array is very large and you're using an OS or version of libc that supports it, be released back to system.

In this case, where your array is 10K elements or so, it's probably not worth it. That's only using 40K of memory, which really isn't that much.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-06-25 10:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.