>>>>> "APK" == Akhthar Parvez K <akht...@sysadminguide.com> writes:

  APK> Yes, I think the memory space allocated by a process using
  APK> malloc() can't be really freed up until the calling process is
  APK> terminated. And processes that uses mmap() can unmap those chunk
  APK> size of memory when it's not needed. I guess Perl by default
  APK> allocates memory using malloc() and changes the memory allocated
  APK> using sbrk(). So how does Perl know it has to mmap() instead if
  APK> the (huge) size was being used incrementally (not at once)? I now
  APK> believe the only way to free up the space used by a small portion
  APK> of your program is forking that part of the program so that it
  APK> will run as a child process and return all the memory used by it
  APK> back to the system. Please correct me if I am wrong.

why are you worrying so much about low level details like mmap and sbrk?
learn perl for what it can do and if you run into memory limitations,
then deal with it. few programs of any kind actually return ram to the
OS even though it is technically possible. it requires much more effort
to manage ram that way and it still may not be possible as it depends on
how the user code allocates and frees ram.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to