On Thu, Nov 10, 2011 at 6:47 PM, Quincey Morris
<quinceymor...@rivergatesoftware.com> wrote:
> You haven't (IIRC) demonstrated that your app is not receiving memory
> warnings.

I implemented both the app delegate and view controller memory
warnings, then set breakpoints at both of them.  The breakpoints don't
get hit.

> You probably have good reason to request (via bugreporter) a mechanism that
> would give apps a clue as to the how much memory they should limit
> themselves to asking for when they know they need "a lot" of memory.

As someone else in this thread pointed out, that would be a race
condition.  Even if the system responded with a reasonable amount,
some other process might allocate enough memory that that amount is no
longer valid.

The only way to do find out how much memory can be allocated without a
race condition is to actually try the allocation, then have it fail if
there isn't enough memory available.
>
 That might be much harder, and might make
> the computational optimization harder, but you'd have a better app (e.g.
> perhaps one where the user didn't need to configure the grid size -- I think
> you said earlier the ideal is an infinite board, not a finite one). Indeed,
> an innovative memory management design may even produce a more effective
> computational optimization.

That's not my issue at this point.

In fact I have been planning all along to store only living cells,
which uses a great deal less memory than storing all the cells.  It's
also a lot faster because one doesn't have to compute the future state
of any cell that's totally surrounded by dead cells.

What I am really, really concerned about though is that the iOS is
inherently unreliable.  Killing off processes that ask for too much
memory doesn't make a system stable.  It causes loss of end-user data,
and makes me loo bad as a developer.

I've done a lot of embedded and device driver programming.  If you
allocate too much memory in those environments, the OS can't kill your
task, the whole machine will crash.

Instead what one does is back out gracefully from resource allocation
failures.  There are many, many ways to do that.  I have already
implemented the code to back out from allocation failure in Warp Life.
 It works correctly on the Simulator - that is, on Mac OS X.

I have filed a Radar bug with a minimal test case, but Apple has not
yet responded.  It usually takes them a while.

There are many other reasons to allocate memory other than to set up a
game playing field.  There are lots of other kinds of resources other
than memory as well.  If we cannot count on the iOS to let us know
when resource allocation fails, we are lost.

Don Quixote
-- 
Don Quixote de la Mancha
Dulcinea Technologies Corporation
Software of Elegance and Beauty
http://www.dulcineatech.com
quix...@dulcineatech.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to