Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory leaks



On Wed, 14 Feb 2007 09:39:27 -0500, Robert DuToit <email@hidden>
said:
>Hi All, I have two studio apps out there. Both are working well but
>one has some memory leaks - I have seen the memory usage creep up in
>Activity monitor, especially after buttons are pressed that call
>certain routines. I wanted to implement and idle handler in the code
>but obviously can't due to this. It is an applescript application
>with a lot of calls to OBJ-C methods, some "do shell scripts" too. So
>I don't know enough OBJ-C to understand the leaks process and if it
>is possible to fix them in this kind of app. Something to do with
>creating and releasing objects? This app has multiple windows within
>the main nib unlike the other app which I have separate nibs for each
>window that are loaded as needed. Not sure if that could cause
>problems but I noticed several references to nibs in the malloc
>report... Any thoughts appreciated. here is a shot of part of the
>malloc report in debugger - which I also don't understand how to
>interpret either. I also ran the 'leaks' command from terminal and
>got a long list there, indecipherable to me. Thanks, Rob D
>
>PS I remember a thread somewhere by Matt Neuburg about memory leaks
>using call methods from applescript?

Yes, basically "call method" is leaky when an Objective-C object is handed
to AppleScript, and there is nothing you can do about it. (In an app of
mine, I was actually able to spot the specific leak; using ObjectAlloc, I
was actually able to see Apple's code setting two extra retains on the
object and not releasing them.) And certain other actions (such as dynamic
menu creation) are leaky and there is nothing you can do about that either.
Such is "the price of frame" - i.e., you're using a framework, so you're
depending on someone else's code. m.

-- 
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.