Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Memory usage and perl

by broquaint (Abbot)
on Mar 14, 2003 at 13:52 UTC ( #243032=note: print w/ replies, xml ) Need Help??


in reply to Memory usage and perl

What happens to memory after is has been removed from perl (shift/undef/delete etc)?
It is 'put back' into the memory pool perl uses when allocating memory. So when you undef something, the memory that it used becomes available again to be re-allocated.
Can it be reused by other apps?
No, only once the process has exitted will the memory be available to to other apps. This is an OS issue, not a perl issue. See. the recent Memory leak when using hash 'references' for more info on the topic.
HTH

_________
broquaint


Comment on Re: Memory usage and perl
Re: Re: Memory usage and perl
by robartes (Priest) on Mar 14, 2003 at 13:59 UTC
    To add to this:
    No, only once the process has exitted will the memory be available to to other apps.
    This is correct, but needs to be qualified. Physical memory (actual RAM) that was taken by the variables (or better, memory pages) that are no longer used can be reclaimed: the pages containing the unused variables get swapped out to disk if some other process needs physical memory ('in core' memory). But the variables do stay in swap. They are only removed from there when the Perl process exits.

    CU
    Robartes-

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2014-12-19 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (75 votes), past polls