I have a couple of projects involving lists which collect data over time, either through other objects or avatars interacting with the object, or, collecting data off of a timer event. In either case, new data is being appended to the lists over time, E.G. a visitor tracker that records visits to an area or clicks to recieve a notecard (name, time of day). My question concerns ways to manage the lists so that I don't run in to out of memory errors or stack heap collissions. I am curious to find out how people manage their memory with open ended lists.
(1) Do lists have internal memory management, e.g. similar to how sensors only detect 16 (or is it 10, i forget) objects or avatars at a time and silently drop the rest?
(2) What are the most efficient methods for managing memory in lists -
(a) what data types (string, integer, float, vector, key) are the most efficient for storing data in lists;
(b) is it more efficient to store a few variables as a single string in a normal list, or, store the variables separate from each other in a strided list;
(c) are there significant memory savings only storing an object/agent's key as opposed to their name (and getting their name at runtime through llKey2Name);
(3) What are ways people employ to cap or limit lists from growing so big they overflow script memory, or, does using up the available free memory by continually adding new list items even cause stack heap collision errors
The most efficient way I can think of to manage memory in an open-ended list is to include llGetFreeMemory() in a timer event and delete the first index entry if the detected memory exceeds some threshold value (which you would determine on a case by case basis depending on the size of each list item). Are there other, more memory efficient ways to truncate a list besides this technique?
Another option might be to have one script contain the bulk of the code and pipe list data to another script that just stores list data through llLinkMessage.
Of course, I can store list data in an external server, but, for the purposes of this discussion, I am trying to avoid the need for an external server.
I've also heard that adding data to a list using MyList += NewListItem is less memory effective than by MyList += ([]) - MyList + NewListItem.
I'm really curious about ways others have dealt with this issue. If you have sample script fragments to share I would truly appreciate it.
)
