• 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: Is launchd a RAM addict?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is launchd a RAM addict?


  • Subject: Re: Is launchd a RAM addict?
  • From: Dave Zarzycki <email@hidden>
  • Date: Fri, 14 Dec 2007 08:43:59 -0800

launchd was rewritten a few times during the development of Leopard. Does this reproduce on Leopard?


On Dec 14, 2007, at 2:50 AM, Stephane Sudre wrote:

OK, I think I've found what happens.

I don't know why but the first time you launch an executable on Mac OS X (10.4.11), it eats more memory than on further launches.

Here is what I'm seeing:

I've built a Cocoa application (but I can see that with a Foundation tool too)

I copy this application (this copy of the application has never been launched) to another location.

I open this application through 'open' for instance (it could be done with a LaunchDaemon script for a Foundation tool).

=> The application eats 12 MB of RAM.

I kill the application and launch it again

=> It eats 3-4 MB of RAM

I kill it and launch it again and again

-> It eats 3-4 MB of RAM

I delete the application and replace it with the never launched copy. I launch it

=> It eats 12 MB of RAM

I kill it and launch it again

=> It eats 3-4 MB of RAM.


I hope the pattern is obvious now.


I would be interesting to know why the first launch of an application takes more RAM. I though about prebinding but this doesn't sound reasonable.



On 27 nov. 07, at 19:12, Dave Zarzycki wrote:

You'll need to run our various memory introspection tools on your program to understand what is going on.

I'd start with the following tools:

leaks
heap
vmmap


Good luck,

davez



On Nov 27, 2007, at 8:14 AM, Stéphane wrote:

Mac OS X 10.4.11:

I have a process that is launched by launchd. It's set as RunAtLoad = true

I have almost exactly the same version of this process launched by a StartupItem (the differences are in strings where a figure is replaced by another).

According to Activity Monitor:

- The process launched by launchd takes 4 MB of Real Memory

- The process launched by launchd takes 1.3 MB of Real Memory

If I kill the process launched by launchd, it's automatically restarted and it takes 1.3 MB of Real Memory.

Of course since even startup items are launched via launchd - but later - it makes me wonder why a delayed launch claims less memory than an early one.


_______________________________________________ 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

_______________________________________________ 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: Is launchd a RAM addict?
      • From: Stephane Sudre <email@hidden>
References: 
 >Re: Is launchd a RAM addict? (From: Stephane Sudre <email@hidden>)

  • Prev by Date: Re: Is launchd a RAM addict?
  • Next by Date: Re: Is launchd a RAM addict?
  • Previous by thread: Re: Is launchd a RAM addict?
  • Next by thread: Re: Is launchd a RAM addict?
  • Index(es):
    • Date
    • Thread