Re: Leak-searching and OmniObjectMeter
Re: Leak-searching and OmniObjectMeter
- Subject: Re: Leak-searching and OmniObjectMeter
- From: email@hidden
- Date: Thu, 09 May 2002 09:35:35 -0700
Andrea Perego wrote:
|My question is about the stack frames: from these you may trace the
|place where an object was allocated, and a nice PB-plugin allows to
|open the source file in your project where the allocation takes
|place. Now, I've seen that almost every
|time the highest spot marked with the "m" code icon is
|"NSApplicationMain(argc, argv)" in "main.m". From this I guessed that:
|- those objects are allocated by the run-time and not directly by my code.
|If there is a leak connected with them, it's not my fault.
|- in order to speed-up the search, wouldn't it be nice to have an
|option by which only objects allocated by one's own objects are shown?
|I'd like to know up to which point my guesses are correct.
Disclaimer: I've never uses OmniObjectMeter, so everything here is, ultimately, speculation. However....
If, by "highest spot", you mean "the topmost routine in the calling stack, the routine that called the routine that called the routine that called your code", then NSApplicationMain being highest probably doesn't actually tell you much. Since NSApplicationMain is called by the main() routine, almost *any* code that's executed will have NSApplicationMain as the highest spot, whether your code or the runtime code. However, if NSApplicationMain *doesn't* appear, then the object was probably created during the initialization of the Objective-C runtime, which is done before main() is called.
It might be nice to filter out objects you didn't allocate, but I have my doubts that it's practical. It's not really possibly to determine which *object* owns the method that allocated an object given only the position in the code that did the allocation. If you create an NSWindowController subclass, then the instance of that subclass is your object. If that object calls a standard NSWindowController method which allocates an object (for example, "[self window]"), do you want the allocated object included in the list or not? It was allocated by your *object*, but not by your *code*. How would OOM decide whether you or the runtime was responsible for allocating the object?
(By the way, a point of grammar: "up" in a verb isn't hyphenated, so it would be just "speed up".)
Glen Fisher
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.