[MUD-Dev] Re: MUD Development Digest

Ben Greear greear at cyberhighway.net
Thu Apr 23 22:49:48 CEST 1998


On Thu, 23 Apr 1998, Dr. Cat wrote:

> What I don't see is where writing code that simply doesn't HAVE any 
> garbage to collect is harder than writing code that has some.  To me it's 
> the other way around, I'd have to be using more of them new-fangled 
> unnecessarily fancy data structures and dynamic reallocation techniques and 
> stuff in order to be able to generate garbage that a garbage collector or 
> heap compacter would need to go messing with.  I just allocate way more 
> than I need of everything, right at startup, and then just keep on using 
> it till shutdown without any fancy shuffling stuff around.  I don't see 
> where there's "more hard work" involved in that than doing it some other 
> way, it seems pretty straightforward to me.  :X)

In java, it is amost necessary to allocate and deallocate
small wrapper classes.  I don't think it's worth the overhead to try to
keep free lists of these objects.  It also makes for much cleaner code
IMHO.  The implicit reference counting is great for unique or unchanging
data.  Pointers made easy (and neutered, but, TANSTAAFL.)

However, I'm all in favor of allocating most of the world right at the
beginning and then just modifying it w/out deleting or creating.  The
time savings come into play when you realize that you can implement some
pretty fancy caching algorithms, without having to worry about memory
leakage.  (Actually, you can leak in java too, but it's easier to avoid.)

I expect my server to have uptimes of over a month regularly, so even
small memory leaks would be a big problem.  But I should stop talking
and get back to writing on it :)


> 
> *-------------------------------------------**-----------------------------* 
>    Dr. Cat / Dragon's Eye Productions       ||       Free alpha test:
> *-------------------------------------------**  http://www.bga.com/furcadia
>   Furcadia - a new graphic mud for PCs!     ||  Let your imagination soar!
> *-------------------------------------------**-----------------------------*


Ben Greear (greear at cyberhighway.net)  http://www.primenet.com/~greear 
Author of ScryMUD:  mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html



--
MUD-Dev: Advancing an unrealised future.



More information about the mud-dev-archive mailing list