[DGD]How many objects can I have?

Erwin Harte harte at xs4all.nl
Mon Jun 11 04:22:05 CEST 2001


On Sun, Jun 10, 2001 at 07:03:23PM -0500, Thomas Annandale wrote:
>   There has been some talk on the memory requirements of dgd.  How each
> library object and each cloned object take up a "sector" (I don't know
> what that is), and I think there was even a report of someone running out
> of memory because of too many objects.

A sector is the allocation unit for the swap-device.  If for instance
the the sector-size is 512 bytes and an object requires 400 bytes of
data, DGD allocates one sector for it.  If it requires anything over
513 bytes, it allocates 2 (or more).  Picking the right sector-size
might help you save some pointless allocations for objects that use
X * sector-size + <small amount> of bytes, but as your mud grows I
don't it matters much and you'll probably want to go for something
like 1-2kB per sector.

>   In the MUD I am currently designing, I was planning on using objects
> very liberally.  I remember one of the first things I read about DGD was
> that it was "disk based", which I thought meant that there was really no
> limit on the number of objects you had, which I found very attractive.  I
> thought that I would be able to keep as many objects in memory as I wanted
> without ever having to clean them up, because the driver would somehow
> "swap" them to disk.  I thought "Cool, I never have to destruct my
> rooms.  Someone could, say, bury something in a room and come back a YEAR
> later and find it still there!"

Yup.  I recently shut down a dusty mud that had been running (with
some reboots from statedump) for over 2 years, I imagine some hiding
spots may have contained stuff that was stored there over a year ago.

It does mean you have to be very careful about what you store on disk
and what you store in object-memory, or else you could run into
inconsistencies when rebooting from an -old- statedump!

>   What are the memory limitations of dgd?  Say I have 32M of memory
> dedicated to dgd.  How many objects can I have in my mud at one time?  Or
> are there other things to take into account as well?

No memory-limitations as such.  With 32M of memory dedicated and a
sector-size of 1024 bytes, I'd imagine you can have 16-32k objects
in memory, depending on whether we're talking about configured clones
(which only require sectors for data) or initialized objects, which
require sectors for both data and code, a minimum of one for each.

Hope this helps,

Erwin.
-- 
Erwin Harte <harte at xs4all.nl>

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list