Re: Solve memory problems [message #64709 is a reply to message #64623] |
Tue, 13 January 2009 07:56   |
Allan Whiteford
Messages: 117 Registered: June 2006
|
Senior Member |
|
|
David Fanning wrote:
> Jean H. writes:
>
>
>> As Carsten has mentioned, play with memtest.pro (from ITTVIS) to find
>> out what is happening. It could as well be a memory leak (you create a
>> pointer but don't destroy it). In this case, make a call to "heap_gc"
>> after your function.
>
>
> What!? What kind of advice is this!
>
> Uh, do NOT be making a call to HEAP_GC unless your program
> has completely and utterly failed and it is late Friday
> afternoon and you are at wit's end. Believe me when I tell
> you there are MUCH better ways to handle this!
>
> Cheers,
>
> David
Perhaps a compromise:
Do a "help,/heap" and see how many pointers you have sitting, then do a
heap_gc followed immediately by a "help,/heap" again. If you're leaking
memory by not freeing pointers or destroying objects then chances are
the two results of help,/heap will be different. If they are the same
then the heap_gc didn't do anything and the problem is elsewhere.
help,/heap will even give you an idea of what heap variable is causing
the problem.
Thanks,
Allan
|
|
|