• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
GC app not releasing memory until click, even if I send
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GC app not releasing memory until click, even if I send


  • Subject: GC app not releasing memory until click, even if I send
  • From: "Mark Aufflick" <email@hidden>
  • Date: Sat, 25 Oct 2008 14:52:16 +1100

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 (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

  • Follow-Ups:
    • Re: GC app not releasing memory until click, even if I send
      • From: Bill Bumgarner <email@hidden>
    • Re: GC app not releasing memory until click, even if I send
      • From: "Kyle Sluder" <email@hidden>
  • Prev by Date: Removing 4 pixels
  • Next by Date: Re: GC app not releasing memory until click, even if I send
  • Previous by thread: Removing 4 pixels
  • Next by thread: Re: GC app not releasing memory until click, even if I send
  • Index(es):
    • Date
    • Thread