[DGD] Dealing with huge objects

Felix A. Croes felix at dworkin.nl
Sun Jul 15 23:51:07 CEST 2007


"=?ISO-8859-1?Q?Petter_Nystr=F6m?=" <jimorie at gmail.com> wrote:

>[...]
> My first attempt at this has simply been to allocate the grid as a
> two-dimensional integer array in a daemon type object. The problem is
> that this grid needs to be rather huge to accommodate for the world I
> want to build. My test case is using a 1000 x 1000 grid - 1 million 32
> bit integer values. When DGD tries to swap out the object holding this
> data, it crashes as it runs out of sectors. I assume this can easily
> be solved by increasing the number of sectors given to DGD at startup.
> But it got me thinking that my approach probably isn't so good to
> start with.

Rather than having a 1000x1000 grid, you could add a level of
indirection and have a 10x10 grid of a 100x100 grid.  Each 100x100
grid could be stored in a separate object.  That way, only those
parts of the 10x10 grid that are actually in use would have to be
swapped in.

Regards,
Dworkin



More information about the DGD mailing list