comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Memory allocation problem:
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Memory allocation problem: [message #11156 is a reply to message #11016] Fri, 27 February 1998 00:00 Go to previous messageGo to previous message
David Kastrup is currently offline  David Kastrup
Messages: 33
Registered: February 1998
Member
jyli@anchor.gsfc.nasa.gov (Jason Li) writes:

> David Fanning (davidf@dfanning.com) wrote:
>
> : This is a result of IDL being written in C and using the C library
> : functions (malloc and free) for memory allocation. In most C libraries,
> : memory that is freed is NOT returned to the operating system. The C
> : program retains this memory and will reuse it for future calls to malloc
> : (assuming that the new allocation will fit in the freed block).
>
> Retains this memory for how long?
> (1) life of a subroutine
> (2) life of a main routine
> (3) life of an IDL session

(3). However, glibc, the library used in newer versions of Linux (for
exmaple) will allocate larger chunks of memory with a different
mechanism making it possible to return such larger pieces of memory to
the operating system the moment they are freed, regardless of
allocation order.

The main advantage of this scheme is not as large as one would na�vely
be let to think, as unused memory tends to get swapped out, anyway,
when memory gets scarce. But at least this avoids more useful memory
pieces to be swapped out instead (causing a bit of thrashing) and it
reduces the general impact on swap space related resources.

If you are concerned about proper resource utilization, you should
choose your operating system accordingly.


--
David Kastrup Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de Fax: +49-234-709-4209
Institut f�r Neuroinformatik, Universit�tsstr. 150, 44780 Bochum, Germany
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: project_vol() in IDL
Next Topic: New dialog routines

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 03:32:24 PDT 2025

Total time taken to generate the page: 1.43768 seconds