ObjectAlloc Instrument: "still living" count too high...
ObjectAlloc Instrument: "still living" count too high...
- Subject: ObjectAlloc Instrument: "still living" count too high...
- From: David Hoerl <email@hidden>
- Date: Tue, 18 Dec 2007 21:51:55 -0500
I used ObjectAlloc under Tiger occasionally to find unreleased
objects, and I managed to get the info I needed. However, now trying
the same thing with Leopard, and I just can't seem to get my arms
around it.
[Just to make the point: I read the whole Instruments User Guide, and
the ObjectAlloc sections and references too, so I made the effort to
find this out beforehand. I also spent a session in google looking
for more info.]
My goal was to see if I was leaking, and if so, how bad (my app is
non-GC 10.4).
I used XC3 to launch my app (Release, not Debug) with Object
Allocations, and no problems. I made sure that "Record Reference
Counts" was on (it was off initially). Also, I have Allocations set
to "Created and Still Living".
So, I start thrashing my app (and also with TextEdit to compare, got
the same results). The Track Pane shows an ever increasing amount of
memory (TextEdit did the same as I opened and shut text windows).
This to me is a clue that I'm not doing something right, but I'm
stumped.
I click on the Net Bytes column, and both my App and TextEdit show
monotonically increasing values as I thrash the app.
Now, with my app, I have incorporated some open source code that
draws a graph using lots of NSBezierPaths. As I thrash the graph, the
number and size of these goes through the roof. The code looks fine -
[NSBezierPath bezierPath] (so its autoreleased). However, ObjectAlloc
is showing a big solid red bar, no transparency, and #Net ==
#Overall. However, its only NSBezierPath, CGPath, and CFString that
show up all red - other objects have a small slice of solid color and
then a big slice of transparent color.
In Table mode, I click on the circled arrow to get to the Detail
Pane, and click on various objects. In all cases you get a view with
all objects that have used that address, and I scroll to the bottom.
What I see is:
# Category Event Type Timestamp Address Size
Responsible Library Responsible Caller
272 NSBezierPath Malloc 09:29.796 0x2b6218e0 96
AppKit +[NSBezierPath bezierPath]
273 NSBezierPath Autorelease 09:29.796 0x2b6218e0 0
Viewer -[GraphView
drawVertBarFromPoint:toPoint:barNumber:of:inColor:]
274 NSBezierPath Release 09:29.797 0x2b6218e0 0
Foundation NSPopAutoreleasePool
that shows the allocation, the autorelease, and the release.
But wait - this object is showing up as still alive, and contributing
to the #Net number (total still alive!).
Any pointers on how to correct my ways most appreciated.
Thanks,
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden