Finding leaking memory - what function to use?
Posted: Wed Mar 28, 2012 2:05 pm
Hi.
I am trying to find a memleak issue.
I am limited to using activity monitor and look for any increase and then guess what function (from debugger output) is running at that time.
Yesterday my program was running using 1.2 GB RAM and now I got it down to around 80 MB - but it still increases everytime I do something.
Is there a function to return the amount of memory used by the program as a integer? That is really what I would need, because then I can put something in the beginning and end of the procedures I want to pinpoint, like:
Similar to what I can do with ellapsedmilliseconds() - but for memory?
I am trying to find a memleak issue.
I am limited to using activity monitor and look for any increase and then guess what function (from debugger output) is running at that time.
Yesterday my program was running using 1.2 GB RAM and now I got it down to around 80 MB - but it still increases everytime I do something.
Is there a function to return the amount of memory used by the program as a integer? That is really what I would need, because then I can put something in the beginning and end of the procedures I want to pinpoint, like:
Code: Select all
Procedure MyFunction()
StartMem.i = FUNCTIONTOGETMEMORY()
;code goes here
Debug Str(FUNCTIONTOGETMEMORY()-StartMem)+" bytes used by function"
Endprocedure