Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^2: How to return unused memory to OS?

by Limbic~Region (Chancellor)
on Jan 11, 2008 at 19:56 UTC ( #661969=note: print w/replies, xml ) Need Help??

in reply to Re: How to return unused memory to OS?
in thread How to return unused memory to OS?

Once Perl has claimed the memory from the OS it will not be returned to the OS' pool.

Really? I have seen Perl give memory back on Windows. I haven't really checked on any other OSes, but I have read:

Cheers - L~R

  • Comment on Re^2: How to return unused memory to OS?

Replies are listed 'Best First'.
Re^3: How to return unused memory to OS?
by CountZero (Bishop) on Jan 11, 2008 at 22:08 UTC
    Most interesting and as usual I have to bow before your superior knowledge of these things.

    I will just add that I never saw the memory used by my Perl scripts get released back to the OS, but that may say more about my scripts than anything else. I have few long running scripts (except some mod_perl applications) so that may be the reason and I try to be parsimonious with memory so there is probably never enough in one block that can get released back to the OS.


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re^3: How to return unused memory to OS?
by ikegami (Pope) on Oct 27, 2009 at 19:38 UTC
    Perl uses a different allocation system on Windows than on other systems by default. You will experience differences in this are as a result.
Re^3: How to return unused memory to OS?
by rizzy (Sexton) on Dec 07, 2010 at 16:38 UTC matter what I do, windows does not reallocate that memory. I'm talking hundreds of megabytes of memory that are not reallocated. There seems to be nothing automatic about least not in my case. Sounds like I need to use siding windows (as suggested by Rolf) or just deal with half of my memory being dedicated to a very simple task for days on end.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://661969]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2018-03-17 18:56 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (225 votes). Check out past polls.