Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How likely is memory fragmentation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How likely is memory fragmentation?



On 12/1/05 10:04 AM, Steve Baxter didst favor us with:

>> VM takes care of memory management so that memory fragmentation  isn't an
>> issue like it used to be. As far as your code is concerned it can  allocate
>> whatever size block you need as long as there's enough remaining of  your
>> 4Gig virtual memory space to fill the request. However, long before  you run
>> out of memory VM is going to start swapping pages to disk and  performance
>> will suffer.
>
> Assumptions are evil!  A G5 can support up to 8GB (maybe even 16GB
> now) of RAM, you can quite easily exhaust a 32-bit address space
> without causing any paging at all (we ship all our G5 systems with at
> least 4GB for instance).

I wasn't assuming, I was speaking in generalities. Most Macs out there have
< 4GB of RAM. In fact, I believe most Macs aren't G5 towers, as I believe
Apple sells more PowerBooks, iMacs, Mac Minis, and iBooks combined than G5s,
and none of those supports more than 2GB IIRC. If you're working with a
product where you can assume the computer on which it runs has 8GB, then
you're okay, but in general you can't. Even when it has 4GB it's not all
available to your application. At the very least the system is using some of
it, and if the user has other applications running, then even less of that
4GB of real memory is devoted to you. FWIW, I don't know the maximum on
this, but I've seen up to half a GB of my application's 4GB memory space
used by system libraries and such, which means I really only had about 3.5GB
of space to allocate (which isn't a problem in my case).

Unless I *knew* that all my users had over 4GB installed I'd code as if they
didn't because VM thrashing -- at least for me -- is a painful and
frustrating experience.

Larry

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

This email sent to email@hidden

References: 
 >Re: How likely is memory fragmentation? (From: Steve Baxter <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.