MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: Strings & Memory Usage
In <199704150252.CAA220829#out1,ibm.net>, on 04/14/97
at 08:07 PM, Greg Munt <greg#uni-corn,demon.co.uk> said:
>Is there a common way to save the memory used up by storing strings?
Yup, its called reference counting. There are several
implementations, and a vast number of optimisations, but the basic
trick is having a central module control storage of all strings.
Whenever a string is submitted to the module for storage, it compares
it to the other strings it finds, and if it finds a dupe, increments
the reference count on the dupe and returns that, or adds it as a new
string (no other copy found).
Obvious optimisations enclude hashing the string lookups to speed
determining if the string in question already exists in the pool.
Note: OSE has a very slick reference counted string class.
>I'm sure something was said on this subject in the RGMA 'MUD Memory'
>thread (by George Reese, IIRC)
Bugger. Another thread to dig up.
>I will probably be using some sort of bytecode compilation on my mud
>now. Would this method of memory saving simply involve checking a
>list of those strings currently in memory, and either adding a new
>string, or adding a pointer to an old string? (that would probably
>slow down the process unless the storage structure was right, tho)
Bytecoding really has nothing much to do with string compression of
reference counting. If fact, for my implementation bytecoding _costs_
me memory as I keep the flat-ASCII version and the bytecoded version
about (I need easy compile/decompile).
--
J C Lawrence Internet: claw#null,net
(Contractor) Internet: coder#ibm,net
---------------(*) Internet: clawrenc#cup,hp.com
...Honorary Member Clan McFUD -- Teamer's Avenging Monolith...
- Thread context:
- Re: Threads and Sockets (Was Ho hum), (continued)
- Strings & Memory Usage,
Greg Munt greg#uni-corn,demon.co.uk, Tue 15 Apr 1997, 03:13 GMT
- <Possible follow-up(s)>
- Re: Strings & Memory Usage,
Jeff Kesselman jeffk#tenetwork,com, Tue 15 Apr 1997, 09:59 GMT
- Re: Strings & Memory Usage,
Shawn Halpenny rsh#dos,nortel.com, Tue 15 Apr 1997, 22:28 GMT
- Re: Strings & Memory Usage,
clawrenc clawrenc#cup,hp.com, Tue 15 Apr 1997, 22:59 GMT
- Re: Strings & Memory Usage,
ashen ashen#pixi,com, Thu 17 Apr 1997, 00:55 GMT
- Re: Strings & Memory Usage,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Mon 21 Apr 1997, 04:03 GMT
- Re: project management (or coding, kings, and other things),
Jon A. Lambert jlsysinc#ix,netcom.com, Mon 14 Apr 1997, 11:15 GMT
- Who is Steward and what can he do for me?,
Jon A. Lambert jlsysinc#ix,netcom.com, Mon 14 Apr 1997, 10:29 GMT
[ Other Periods
| Other mailing lists
| Search
]