Re: Allocating too much memory kills my App rather than returning NULL
Re: Allocating too much memory kills my App rather than returning NULL
- Subject: Re: Allocating too much memory kills my App rather than returning NULL
- From: Don Quixote de la Mancha <email@hidden>
- Date: Tue, 08 Nov 2011 22:51:33 -0800
On Tue, Nov 8, 2011 at 10:47 PM, Graham Cox <email@hidden> wrote:
> Getting back to the original problem, you don't state how big a grid you want. But it seems to me that a bitmap like this can be stored very efficiently because it has a lot of zeroed out space. Run-length encoding for example should compress it very substantially. You might need to roll your own bitmap structure to access it and store it since the overhead of arrays and so on might be what's killing you.
It's user-configurable. If the user asks for too big a grid, I want
to be able to tell them that there isn't enough memory, then suggest
they try a smaller grid.
In fact I do plan to use more-efficient and therefore more-complex
data structures that will use less memory, and run faster as well.
But that doesn't fix the problem of my process being killed without
warning when it uses too much memory. While a better algorithm would
allow the effect of a much larger grid, Conway's Life patterns can
grow without bound. I need to know ahead of time when further growth
is not tolerable.
--
Don Quixote de la Mancha
Dulcinea Technologies Corporation
Software of Elegance and Beauty
http://www.dulcineatech.com
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden