• 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
Another question about pool strategies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another question about pool strategies


  • Subject: Another question about pool strategies
  • From: Matt Mashyna <email@hidden>
  • Date: Fri, 15 Feb 2008 16:13:27 -0500

I've been playing with a server app that listens for connections on a port by setting up an NSFileHandle with a NSFileHandleConnectionAcceptedNotification notification. It's all nice and tidy with Cocoa. What I run into is a growing pool footprint. MallocDebug tells me that none of my objects are leaking but the footprint grows because I haven't found the right way to manage the pool.

I run into trouble, I think, because the notification that a connection has arrived causes some new objects to be allocated, used and then released but this happens asynchronously. Some objects hang around for follow up connections and are released later. These objects, I think, never get drained.

For a server process this is not acceptable because it slowly uses up app the system memory.

I'm looking for a strategy that will allow me to set up a pool I can periodically drain in an asynchronously driven system. I tried to set up pool in my controller object's init method, that starts listening, and drain it when the connection closes but that doesn't seem to work.

I'd like some advice to reorganize my project to keep the pool for growing out of control.

_______________________________________________

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


  • Prev by Date: Re: [Foo new] vs [[Foo alloc] init]:
  • Next by Date: Re: [Foo new] vs [[Foo alloc] init]:
  • Previous by thread: Re: Segmented Control Question?
  • Next by thread: Re: [Foo new] vs [[Foo alloc] init]:
  • Index(es):
    • Date
    • Thread