Items loaded in memory

Posted by Neves on Wed 11 Apr 2007 04:43 AM — 4 posts, 17,420 views.

USA #0
I've noticed that the SMAUG lib loads things into memory, like areas, helpfiles, etc. I am wondering why does it do this, to save memory upon later request? If i was to change this would it cause increased lag?

-Mark
USA #1
What would you change it to do?
Australia Forum Administrator #2
Areas are referenced almost all the time, it is hard to imagine a better way of storing them than in memory.

Conceivably you could load help data on request, however as a player somewhere is likely to be getting help on something fairly frequently, opening a file and reading it in, every few seconds, is likely to be a lot slower.
USA #3
A running copy of SMAUG uses relatively little memory especially with respect to the massive amounts of memory available these days. My game, which is quite large, only uses 60mb. Let the OS take care of swapping memory out if needed.

I agree with Nick, the hit you will take by constantly referring to disk is going to be much slower. Just let the OS take care of swapping out unused memory and bringing it in when needed.

Memory management tricks are more important when you have a data set of, set, a gigabyte, and you absolutely must have the minimum possible in RAM because you have so much of it.