in reply to Re: Perl, C and deallocation responsibility
in thread Perl, C and deallocation responsibility
> Of course, Perl will never release any memory back to the O/S, but it will reuse it for its own purposes!
This is not correct. It depends on the implementation of the user-level malloc function. For more detail, see:
which notes that on Linux and Windows at least (unlike most other Perl platforms) the standard C Library malloc function does return "big" chunks of memory back to the OS.
Update: Though it's possible for a Perl built with a suitable malloc function to return memory to the OS, in practice this happens rarely, as described in ikegami's excellent Mini-Tutorial: Perl's Memory Management - which concludes with "You can't rely on memory being returned to the system, but it can happen ... if and when memory is returned to the OS is dependant on the memory allocation mechanism perl was compiled to use ... you are more likely to see memory being released to the OS on Windows".
See also:
References Added Later
Updated: minor improvements to wording; added extra references.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Perl, C and deallocation responsibility
by Marshall (Canon) on Apr 30, 2023 at 07:11 UTC |