Re: Operations Beachball
Re: Operations Beachball
- Subject: Re: Operations Beachball
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 04 Dec 2012 18:48:51 +0700
On 4 Dec 2012, at 18:10, Roland King <email@hidden> wrote:
> Can you not run Instruments from the 'Profile' button on Xcode? It should start the process and attach to it and go from there.
I got the Leaks Instrument to work this way (no Leaks) But all other Instruments just prompted repeatedly for an admin password but did not do anything at all.
Activity Monitor gave me a Sample. Here is the main thread:
Call graph:
1343 Thread_3102216 DispatchQueue_1: com.apple.main-thread (serial)
+ 1343 start (in libdyld.dylib) + 1 [0x7fff983887e1]
+ 1343 NSApplicationMain (in AppKit) + 869 [0x7fff96809cb6]
+ 1343 -[NSApplication run] (in AppKit) + 517 [0x7fff96865283]
+ 1343 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit) + 128 [0x7fff9686ded2]
+ 1343 _DPSNextEvent (in AppKit) + 685 [0x7fff9686e613]
+ 1343 BlockUntilNextEventMatchingListInMode (in HIToolbox) + 62 [0x7fff90ec2cd3]
+ 1343 ReceiveNextEventCommon (in HIToolbox) + 217 [0x7fff90ec2db7]
+ 1343 AcquireEventFromQueue (in HIToolbox) + 561 [0x7fff90eccf8f]
+ 1343 _NotifyEventLoopObservers (in HIToolbox) + 155 [0x7fff90e9b6e0]
+ 1343 HIApplication::EventObserver(unsigned int, OpaqueEventRef*, void*) (in HIToolbox) + 193 [0x7fff90ecd407]
+ 1343 HIApplication::HandleActivated(OpaqueEventRef*, unsigned char, OpaqueWindowPtr*) (in HIToolbox) + 177 [0x7fff90ecfe0f]
+ 1343 SetMenuBarObscured (in HIToolbox) + 221 [0x7fff90ed0144]
+ 1343 MenuBarInstance::Show(MenuBarAnimationStyle, unsigned char, unsigned char, unsigned char) (in HIToolbox) + 625 [0x7fff90ea5063]
+ 1343 BroadcastToolboxMessage (in HIToolbox) + 294 [0x7fff90e6e12a]
+ 1343 HIS_XPC_CFNotificationCenterPostNotification (in HIServices) + 532 [0x7fff8e57f174]
+ 1343 CFNotificationCenterPostNotification (in CoreFoundation) + 115 [0x7fff95edbbf3]
+ 1343 _CFXNotificationPost (in CoreFoundation) + 1109 [0x7fff95ecced5]
+ 1343 -[_NSDNXPCConnection sendMessage:waitForAck:] (in CoreFoundation) + 347 [0x7fff95fec12b]
+ 1343 _dispatch_semaphore_wait_slow (in libdispatch.dylib) + 241 [0x7fff97ed0486]
+ 1343 semaphore_wait_trap (in libsystem_kernel.dylib) + 10 [0x7fff95ac86c2]
I have no idea, what this means.
Maybe someone can enlighten me.
Gerriet.
>
> On 4 Dec, 2012, at 7:02 PM, "Gerriet M. Denkmann" <email@hidden> wrote:
>
>>
>> On 4 Dec 2012, at 17:49, Mike Abdullah <email@hidden> wrote:
>>
>>> You have a performance problem. Thus you should use Instruments to see what is going on, rather than hope we can tell you from vague snippets of code.
>>
>> Maybe I should use Instruments, problem is: I cannot.
>>
>> I start Instruments, select some template (e.g. Leaks), attach to a (user-)process, click "Record", and now a panel comes up (which I have never seen before): "Instruments wants permission to analyse other processes. Type an admin...".
>> Annoying, but maybe necessary.
>>
>> But now nothing happens, i.e no recording takes place.
>> What magic do I have to perform to make Instruments (4.5) work?
>> (I asked this on the Xcode list already, but got no answer).
>>
>>>
>>> On 4 Dec 2012, at 10:29, "Gerriet M. Denkmann" <email@hidden> wrote:
>>>
>>>> My app creates lots of MyOperations (subclass of NSOperation) and puts them into an NSOperationQueue.
>>>>
>>>> I would expect that the app thus remains responsive, but sometimes it is not.
>>>>
>>>> A sure way to beach-ball my app is: start it with a few hundred operations (which will take about 20 seconds to finish).
>>>> Make some other app active.
>>>> Try to make my app active again - it's panel stays grey and after a few seconds the cursor will turn into a beach-ball.
>>>>
>>>> These MyOperations interact with their controller in two ways:
>>>>
>>>> 1. they do once at start: [ controller dataStringFor: row ];
>>>>
>>>> The controller has:
>>>>
>>>> - (NSString *) dataStringFor: (NSUInteger)row
>>>> {
>>>> @synchronized(self)
>>>> {
>>>> if ( self.stringArray == nil ) { create it - takes some time, but happens only once};
>>>> }
>>>> return self.stringArray[row];
>>>> }
>>>>
>>>>
>>>> 2. When MyOperations have finished their work they call: [ controller done: row result: someNumber ];
>>>>
>>>> The controller has:
>>>>
>>>> - (void) done: (NSUInteger) row result: (NSUInteger) someNumber
>>>> {
>>>> @synchronized(self)
>>>> {
>>>> [ self.rowsToDo removeIndex: row ]; // NSMutableIndexSet
>>>> };
>>>>
>>>> // sometimes do some logging, update user interface - but only every few seconds
>>>> }
>>>>
>>>> So, why the beach-ball? What am I doing wrong? How to debug this? Why does the app-switch make the beach-ball appear?
>>>>
>>>> Gerriet.
>>>>
>>>> 10.8.2, Arc
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>>
>>>> Cocoa-dev mailing list (email@hidden)
>>>>
>>>> Please do not post admin requests or moderator comments to the list.
>>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>>
>>>> Help/Unsubscribe/Update your Subscription:
>>>>
>>>> This email sent to email@hidden
>>>
>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden