Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is launchd a RAM addict?



On Dec 14, 2007 2:50 AM, Stephane Sudre <email@hidden> 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.

It may have something to do with working set cache that Mac OS X can
maintain. On the first launch of an application no usable cache of the
working set exits so it likely loads in more pages then needed when
launched the first time (best guess). On secondary launches it has a
better picture of the working set needed at launch.

Of course countless other things can also play into this...

-Shawn
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Is launchd a RAM addict? (From: Stephane Sudre <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.