Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Perl Memory problem ...

by eyepopslikeamosquito (Archbishop)
on May 10, 2020 at 20:38 UTC ( [id://11116654]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl Memory problem ...
in thread Perl Memory problem ...

Perl won't release memory back to the operating system at runtime, only on global destruction as the script terminates.
While that may be true for most practical purposes, I believe Perl simply defers to the implementation of the user-level malloc function - see for example: Memory is not released back to operating system.

Last time I looked, both Linux and Windows malloc do return "large" chunks back to the OS.

Replies are listed 'Best First'.
Re^3: Perl Memory problem ...
by davido (Cardinal) on May 11, 2020 at 14:51 UTC

    Thanks. I was probably misremembering Tim Bunce's YAPC talk: https://www.youtube.com/watch?v=GIIeOntmojg. I'll have to review it again when I have a moment. Your research looks thorough, though.

    Update: At about 4:10 Tim discusses malloc behavior, and suggests that larger allocations are mmapped, and the gist seems to be that while rare for malloc to actually give back, it is more likely for those larger mmapped chunks. So, thanks for motivating me to find that talk again. I'll have to watch the rest of it again this evening. It does confirm your assertion, too.


    Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (10)
As of 2024-04-16 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found