| Re: direct graphics or object graphics ? [message #60902 is a reply to message #60780] |
Mon, 16 June 2008 07:06  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
David Fanning <news@dfanning.com> writes:
> Bill Triplett writes:
>
>> On the machine I'm rendering on, this wouldn't be a problem except that
>> IDL does not seem to relinquish that memory after the view has been
>> rendered and the objects destroyed. Its only after the IDL process quits
>> that the memory is recovered by the OS. This seems contrary to the way
>> IDL manages its heap.
>
> It is contrary to the way IDL manages its heap, but the
> heap is already in process memory anyway. But not
> relinquishing memory is standard operating procedure, as
> far as I know, for any program written in C and using
> malloc and free to allocate and free memory.
David, I believe that most modern malloc()/free() implementations
*can* relinquish memory back to the system -- at least under Unix --
but it may not always be obvious when it can and when it can't.
The most obvious example would be a function with no side effects,
that temporarily uses a lot of memory. During the function call, some
additional memory is allocated from the top of the heap, and after the
function is finished, the heap can be reset to its original size.
However, such behavior is highly dependent on your system and your
call pattern, so it will not *always* hold. (i.e. it's the memory
fragmentation problem)
Craig
|
|
|
|