Re: Solve memory problems [message #64720 is a reply to message #64623] |
Tue, 13 January 2009 05:57   |
Carsten Lechte
Messages: 124 Registered: August 2006
|
Senior Member |
|
|
Corinne wrote:
> However, specially when running an already optimized routine several
> times (e.g. for several scenes), available memory will disappear over
> short or long.
All the memory you use in a function or procedure is given back when that
function returns, except for any variables that are handed back via
arguments or function return values.
This is pure conjecture, but maybe you use some memory in your function, then
allocate more memory for the return value, then return, freeing the earlier
memory, but leaving you with the return value allocated somewhere "in the
middle" of the heap memory, thereby fragmenting it more and more with each
call of the function. Then, it should make a difference if you allocate
your return array at the beginning of your function.
Maybe you could use memtest.pro to investigate the fragmentation problem?
chl
|
|
|