Re: Perl memory manager



[A complimentary Cc of this posting was sent to
Nishant
<nishant.031@xxxxxxxxx>], who wrote in article <ebe644b7-62d8-463f-b378-097d8a366bed@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:
Hi ,
My understanding about the perl memory manager is that it initially
allocates a chunk of memory and allocates more memory when required.
but it does not return the whole memory to the OS. Rather, it keeps it
with itself ,so that the next time it has to use memory , it can use
it from the already chunk of memory that it has. Is my understanding
correct ?

No. What you wrote is applicable to Perl configured with mymalloc.
Perl's compiled with system malloc() will behave differently.

Also, what is the size of the chunk of the memory that perl allocates
at one time. Is it variable ?

This is kinda documented somewhere. About 10 years ago, mymalloc
default was to start with about 48K, then increase in >= 3% increments.
Configurable at compile time.

Hope this helps,
Ilya
.



Relevant Pages

  • Re: [Vuln-Dev Challenge] - VulnDev1.c Summary
    ... meaning the chunk is allocated with mmap. ... turn calls munmap on an invalid memory address. ... > the Doug Lea algorithm as well has heap-based exploitation methods ... > the forward chunk, in our case buf2, is free. ...
    (Vuln-Dev)
  • [RFCv6 04/13] mm: cma: Contiguous Memory Allocator added
    ... allocating physically contiguous chunks of memory. ... per-platform and it is easy to add custom allocator algorithms if one ... The Contiguous Memory Allocator (CMA) is a framework, ... whenever it requests memory chunk. ...
    (Linux-Kernel)
  • The Malloc Maleficarum
    ... Glibc Malloc Exploitation Techniques ... the exploitation of overflowed dynamic memory chunks on Linux. ... I have the House of Prime. ... a malloc chunk. ...
    (Bugtraq)
  • [Full-disclosure] The Malloc Maleficarum
    ... Glibc Malloc Exploitation Techniques ... the exploitation of overflowed dynamic memory chunks on Linux. ... I have the House of Prime. ... a malloc chunk. ...
    (Full-Disclosure)
  • [PATCHv2 2/4] mm: cma: Contiguous Memory Allocator added
    ... allocating physically contiguous chunks of memory. ... run-time and it is easy to add custom allocator algorithms if one ... The Contiguous Memory Allocator (CMA) is a framework, ... whenever it requests memory chunk. ...
    (Linux-Kernel)