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: Determining reasonable memory use



On Sat, 29 Jan 2005 17:30:55, Laurence Harris <email@hidden> wrote:

> There's another VM issue that can bite you. When you allocate memory, say
> with NewHandle(), the system doesn't really do much more than make sure
> there's room within your 4GB space. It does not, as you might suppose,
> verify that there's sufficient space on disk for VM to actually provide all
> the memory you requested. For example, suppose you call NewHandle(.9GB).
> Suppose further that this is allowable given the available space in your
> memory space. But suppose there is only .4GB left on the hard drive for VM
> to grow swap files. Uh oh. The Memory Manager will let you allocate the
> handle, but if you try to actually write to all of it, your Mac will fall
> down. And Apple can't fully address this problem. To do that, the VM system
> would have to reserve 4BG of disk space for every running application,...

Or carefully track memory usage and compare it to remaining space.
In other words, malloc should "reserve" vm space and this reservation
should be honored by other mallocs or file operations (!) and that
should be system wide. If that is true, then in the above example
NewHandle(.9GB) will fail and NewHandle(.4GB) will succeed.

Mike

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

This email sent to 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.