[MUD-Dev] Persistent Worlds

Jon Lambert tychomud at ix.netcom.com
Wed Feb 21 09:46:56 CET 2001


Ryan Rhodes wrote:

> If I am understanding you right any objects maintained in cache by
> the Object Model would be in duplicate to the version maintained in
> disk / cache by the RDBMS?

Maybe, maybe not.  You don't have much control over what objects
appear in an RDBMS's data cache.

> I think I understand what your saying here about access patterns,
> but let me ask you this.  In terms of frequency of access, some
> objects might even need to be in memory at all times, like the
> player object or perhaps the rooms of the central town of the world.
> Do you break your DB abstraction by configuring it to always cache
> certain data, or do you put special cases in your Object Manager
> making it's caching functionality less generic? If not, does the
> caching scheme in your Object Manager automatically pick up all
> these items in the most efficient manner?

The simple algorithm I mentioned handles access frequency and aging of
objects in the cache.

> Is there a hard (possibly configurable) limit on how many objects
> the object manager will cache?

Yes.  I allocate the cache memory from non-pageable memory (NT's
VirtualLock).  That memory is limited by both the OS configuration and
real memory on the machine.  The cache is reconfigurable from within
the server environment.

> Or, perhaps a better question, do you just shoot yourself in the
> foot by trying to guess the most frequently accessed objects in the
> first place, rather than letting a nice routine handle it?

There's no guessing involved.

  1) A cached object's age is incremented every n seconds.

  2) Any access to a cached object causes its age to be reset to 0.

  3) Cached objects above an age threshold will be bumped out of the
  cache, if the space is needed.

> It just seems as though the player object should always be in
> memory.

Now _that_ would be guessing.  :-)

There's another problem you will have with Java (and even with
controlled memory allocation to a general memory heap).  The operating
system controls whether your cache is in memory or has been paged out
to disk.  I don't have that problem since I've instructed the OS to
keep it's dirty paws off it.

--
--* Jon A. Lambert - TychoMUD        Email:jlsysinc at ix.netcom.com *--
--* Mud Server Developer's Page <http://tychomud.home.netcom.com> *--
--* If I had known it was harmless, I would have killed it myself.*--
 
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list