Console App Memory Question

Ok back to the thread. Here are the stats from 12 runs of my Code. Notice it ramps up fast but then tapers out? Weird since it is running the same code against the same three devices four times. Any thoughts guys? Thank you again.

1
Runtime Memory used: 5901536
Runtime Object Count : 12

2
Runtime Memory used: 5983184
Runtime Object Count : 260

3
Runtime Memory used: 6022272
Runtime Object Count : 379

4
Runtime Memory used: 5988096
Runtime Object Count : 481

5
Runtime Memory used: 6023984
Runtime Object Count : 479

6
Runtime Memory used: 6041168
Runtime Object Count: 479

7
Runtime Memory used: 5984064
Runtime Object Count : 481

8
Runtime Memory used: 6027232
Runtime Object Count : 479

9
Runtime Memory used: 6037088
Runtime Object Count: 479

10
Runtime Memory used: 5981520
Runtime Object Count : 481

11
Runtime Memory used: 6029216
Runtime Object Count : 480

12
Runtime Memory used: 6037168
Runtime Object Count : 480

Insomnia sucks ? :stuck_out_tongue:

The rest it is kind of hard t osay without knowing more about what is going on & whether or not you’re properly releasing object references (ie/ no reference cycles)

Once it goes up to what you see in 10 11 12 (those are loop iterations?) does it stabilize there ?

Every third is a loop. It stabilizes by way if very small increments consistent with the memory used we see above.

Ok for the dumb question of the night and since this part is new to me… What should I look for to see if I am releasing properly? My code structure is mainly 4 modules with multiple classes attached to the modules. Only one module has methods/properties on the module directly. I was assuming the reference counting would destroy my objects after they ran, but I am clearly not right :wink: I am even setting my classes to NIL at the end of then run which didn’t do anything. I know there isn’t a ton to do without the code, but any pointers to documents or commands use to track this would be of help.

I am also not using Destructors.

Thanks again!

Also I killed the ICP software and reran it… It gave me the EXACT Object Counts every time like above… Clearly I am consistent :wink:

[quote=58481:@Mike Cotrone]
Ok for the dumb question of the night and since this part is new to me… What should I look for to see if I am releasing properly? [/quote]
Usually object count just continues to grow & grow
Since yours doesn’t seem to that may not be the issue

You could fire up Xcode’s instruments & target your app with the Leaks template & that should tell if there are leaks

Not using a destructor is fine - objects still get reference counted & destroyed if they do not have other objects holding them in memory (hence why I asks about reference cycles)

Thanks Norman!

Norman first thank you for introducing me to Xojo Instruments… Wow those are very cool tools. So far it reported 0 leaks and I am playing with some of the other features. Thank you again!

Xcode Instruments
Awesome tools and they get a TON better every release