• 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
Re: Mach port leakage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mach port leakage


  • Subject: Re: Mach port leakage
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Thu, 12 Aug 2010 17:30:06 +0200

Le 12 août 2010 à 17:22, Nathan Herring a écrit :

> I'm trying to track down a case where we appear to be leaking Mach ports,
> and have a repro case where if our code is called via [self
> performSelectorInBackground:@selector(myCode) withObject:nil], we appear
> (via the Activity Monitor) to leak exactly one port. This doesn't occur if
> it happens on the main thread, and it doesn't occur with other calls. :/
>
> I've tried using Instruments and a custom DTrace command to log calls to
> mach_port_allocate(_qos|_full)?, mach_port_destroy, and mach_port_deallocate
> to see if I can figure out the culprit, but it doesn't appear to show up.
> Plus there're a bunch of calls to mach_port_deallocate that don't seem to
> have a matching allocate (which is a different problem). Am I missing some
> major mechanisms for ports to be called into existence or destroyed?

deallocate release a reference on a send port. There is many way to get this kind of port. You can receive it from an IPC call, create it from a receive port or from an other send port, etc…
There is also a call equivalent to "retain" that increase the reference of the port and should be balance by deallocate call.

What do you mean by "leak" ? It creates one port each time you call the method, or it create it once, and keep it alive for the process lifetime ?

-- Jean-Daniel




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Mach port leakage
      • From: Nathan Herring <email@hidden>
References: 
 >Mach port leakage (From: Nathan Herring <email@hidden>)

  • Prev by Date: Mach port leakage
  • Next by Date: Re: Mach port leakage
  • Previous by thread: Mach port leakage
  • Next by thread: Re: Mach port leakage
  • Index(es):
    • Date
    • Thread