Hi all,

I'm going mental here. I have an app, using garbage collection, that
responds to distributed notifications. All the memory allocated by the
method that responds to those notifications builds up (watching in top
or Instruments) until a real UI event is recieved - click on a
menu/window etc.

To try to flog the event loop into draining the pool I post an
NSApplicationDefined event as per
http://www.mikeash.com/?page=pyblog/more-fun-with-autorelease.html and
other documents, but it doesn't clear the memory. I know the event is
being posted because if I subclass NSApplication I can log the events
being recieved in sendEvent:

    [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined
                                        location:NSZeroPoint
                                   modifierFlags:0
                                       timestamp:0
                                    windowNumber:0
                                         context:nil
                                         subtype:0
                                           data1:0
                                           data2:0]
             atStart:YES];

Is there something special I need to do to have the garbaage
collection collect inside a notification observer? If I let the
application run overnight being fed regular notifications, the size
gets over 100Mb of wasted memory, which I assume would be beyond the
garbage collection threshold? Certainly any click on the app drops it
down to 14Mb immediately.

Mark.

-- 
Mark Aufflick
  contact info at http://mark.aufflick.com/about/contact
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to