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 Jan 31, 2005, at 3:16 PM, Mike Kluev wrote:

On 30/01/2005 11:30 Pm, Eric Schlegel wrote:

On Jan 30, 2005, at 9:57 AM, Mike Kluev wrote:

With the current "optimistic" implementation he will get back non null
but may crash on attempt to write to that memory.

I don't believe that will actually ever happen (if it does, it's a bug;
it _should_ never happen). If you overcommit your memory usage such
that there's not enough disk space to fulfull it, the kernel will start
blocking the threads of non-essential applications, allowing
loginwindow to put up the "you've filled up your disk; please quit some
apps" dialog box, which will free up enough memory to allow apps to
continue running.

That's ok as long as:
- it works (I hope so)
- there is user nearby (server app? 4 AM?)
- there are apps to quit (or files to delete)

#1 - if it doesn't work, file a bug, but it's worked when I've run across it.
#2 - without user interaction, on a system with no available disk or memory resources, you really are stuck. There is no choice but to wait for someone to fix up the problem. The only real alternative would be to have automated resource-freeing (i.e. like Windows Cleanup--get rid of old log/temporary files, etc), and even then that will only briefly delay the inevitable, not solve the problem. The computer isn't generally allowed to make judgment calls like "this process or file is worth deleting so I can have more swapfile space"--and most people like it this way :)
#3 - if there's nothing to quit or delete, once again, you really are stuck until an admin can delete or quit something non-essential.

There really isn't a magic bullet once you're out of resources... I don't know what you'd expect to happen in these situations. Something has to give, and in most situations only a human can decide what is really essential and what isn't. Yes, if there's dead air in the system somewhere, it would be nice to get it squeezed out, but if you're writing a VM system, you have to assume that at some point you will not have enough physical resources to satisfy incoming requests, and at that point you need a strategy for dealing with it. Blocking the thread about to overcommit, and asking the user to free up resources, is as good a policy as I could devise.
 _______________________________________________
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

References: 
 >Re: Determining reasonable memory use (From: Mike Kluev <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.