Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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.


Replies are listed 'Best First'.
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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://243032]
[zentara]: TGIF, I'm blowing my mind watching Casimir Effect & Black Holes - Sixty Symbols I love 60 Symbols. :-)
zentara ..oO the vacuum is teeming with photons and micro-blackholes

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-06-23 16:10 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (552 votes). Check out past polls.