Leak search and ObjectAlloc
Leak search and ObjectAlloc
- Subject: Leak search and ObjectAlloc
- From: Andrea Perego <email@hidden>
- Date: Fri, 12 Oct 2001 19:18:46 +0200
Hi!
I'm moving my first steps into the realm of Cocoa: just for now, I'm
playing a little ( <= 2hours/week, given my more pressing / less
interesting duties ;-( ).
Gone thru the trivial "Currency Converter" tutorial, I've written,
just as an exercise, a trivial game with a single UI window and just
a few more classes than "CC". Then, I've become worried about memory
leaks: I've read the Obj-C manual and the messages that appeared
recently in this list [thanks to all!]
and I believe I've grasped the basic concepts (retain, release, autorelease).
So, I started to experiment on my own, but the results are not so encouraging:
- the command line utility "leaks" seems to find memory leaks almost
everywhere,
even in applications one should trust....;->
- I've tried debugging both "CC", my stupid game (BTW, it's the name
I chose for it) and others apps by means of "ObjectAlloc" and I've
found some weird (at least for me!) results. Let alone the fact that
the current total # of objects fluctuates with time even when no user
interaction has taken place (I might
guess some good reason for this), just clicking a menu name in the
menu bar, without choosing any item, causes the total # of objects to
raise. A repeated click on the same menu title seems to cause 9 new
objects to be allocated each time(e.g., a new object is allocated
both in CFRunLoop an CFRunLoopMode).
I don't want to bother you any longer, but my question is: are there
some practical tutorials on the subject of memory checking, besides
the skimpy info that comes with the apps?
TIA
Andrea Perego
Univ. of Florence - Phys. Dept.