[MUD-Dev] Persistent Worlds

Jon Lambert tychomud at ix.netcom.com
Fri Feb 23 00:51:25 CET 2001


Ryan Rhodes wrote:
> Jon Lambert wrote:

> When you say reconfigurable, can you allocate memory or set limits
> on a per class basis?

Nope.  I do move objects to certain pools in the cache based on their
memory size though.  If I know X objects are a certain size I know the
pool they are in and the statistics associated with that pool.

> I think your hearing the reverse of what I'm saying here.  Yeah,
> theres no guessing involved with this algorythm, but if you then
> made it reconfigureable from within the server and allocated more
> memory to certain classes, like the player class, that would be
> guessing.  At least thats what I'm saying here.

The object manager simply hasn't a clue what the function of any given
class is.  It only knows how frequently it is accessed. If I did make
it aware of the role of an object, I would likely have to reintroduce
strong coupling to the other pieces of my application.

I suppose if I wanted to I could add a bias flag to the interface to
allow requestors to indicate to the object manager that the object
requested should be treated differently.
 
> Right :)  Do you guess?

No.
 
>> 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.

> I don't follow you here??  Assuming memory is available to the JVM,
> if I allocate memory for an object it will be in memory, right?

No.  It may be in memory it may be swapped out to disk by the
operating system for any number of reasons.  If in doubt, run the
system monitor and watch the "memory manager:page faults" display when
you run your Java application.

> Of course I'm asking myself now why I'm even talking about a memory
> caching system in java, because with the garbage collection I can't
> even really deallocate the memory to take an object out of the cache
> anyway can I?
 
I bet caching has its uses in Java.  The cache would just hold the
last reference to an object after you are done with it.  That object
will not be destructed and garbage collected.  Therefore you need not
have to ask your database for it, and construct it.

So the cache could be just a collection of Objects.  All you need is a
routine(thread) to manage that cache.  That routine would limit the
size of the cache and delete unused items out of 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