Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Memory

Dan Medici
Registered User
Join date: 25 Jan 2004
Posts: 132
11-28-2004 20:34
As some of you may know, I'm working on a project in which a satellite traverses across the SL mainland and gathers the land heights of 16x16 blocks of every sim, and then sends it back to a server which divides the data between multiple sub-servers. (It's going to be used to generate a 3D map of the entire SL world eventually). The satellite's movement script is fine. The problem is, it needs to only report information back from sims that it hasn't visited. Originally I just made a list, and every time it encounters a new sim, it adds it to the list. Then, it only reports data from sims that are not on the list. However, I get a stack-heap collision error because there are over 100 mainland sims and there is way too much data for one list. Does anyone have any suggestions to bypass this problem?
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
11-28-2004 22:30
is the memory storage in a seperate script using link messages?

and would storing the results of llGetRegionCorner rather than sim names be more efficient?

first thoughts...

UU
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
11-28-2004 23:34
umm far as I know a list can hold up to and more then 500 lines. The only limit it has is the amount of memmory free. But you can only add 50 line to a list at a time. so.. if you want 100 lines. Declare the list with 50 lines, and then add another 50 lines to the list.
Dan Medici
Registered User
Join date: 25 Jan 2004
Posts: 132
11-29-2004 06:29
Upshaw; the linked messages to self sounds like a good idea. I'm going to try that, thanks a lot.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
11-29-2004 08:07
Instead of collecting the data and then sending it all at once. Why not send it one sim at a time? This way, the system is infinitely scalable; perhaps a seperate-memory script may help you now, but when the world grows, it might not.

From: Upshaw Underhill
and would storing the results of llGetRegionCorner rather than sim names be more efficient?

Not necessesarily. Assuming the maximum length of a sim's name is 255 characters, its maximum size is 255 bytes. On the other hand, a vector is composed of three floats, each 32 bytes large, making the size of the vector, assuming no overhead, 96 bytes.

So for sim names shorter then 96 characters, storing the name is more efficiant, size-wize, then storing the vector. Since currently no sim's name is over 96 characters, you can safely assume that storing the name is the more efficiant way to do what you want.

Then again, if you really want to be certain about the size of the value you're storing, since, disreguarding the theoretical limit of 255 characters, strings can be of infinitely long, you should use a vector.

==Chris
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
11-29-2004 09:14
From: Christopher Omega
Not necessesarily. Assuming the maximum length of a sim's name is 255 characters, its maximum size is 255 bytes. On the other hand, a vector is composed of three floats, each 32 bytes large, making the size of the vector, assuming no overhead, 96 bytes.


Isn't that supposed to be 32 bits == 4 bytes per float == 12 bytes per vector?
_____________________
Apotheus Silverman
Shop SL on the web - SLExchange.com

Visit Abbotts Aerodrome for gobs of flying fun.
Dan Medici
Registered User
Join date: 25 Jan 2004
Posts: 132
11-29-2004 13:01
Chris, I DO send the information one sim at a time. The problem was, the satellite was handling the heights of the current sim in one big list, as well as the names of every sim it has visited. It needed this list because it needs to keep track of which sim it has visited so that it only sends data back from new sims.
Tony Tigereye
Registered User
Join date: 4 Sep 2003
Posts: 165
11-29-2004 14:17
From: Dan Medici
Chris, I DO send the information one sim at a time. The problem was, the satellite was handling the heights of the current sim in one big list, as well as the names of every sim it has visited. It needed this list because it needs to keep track of which sim it has visited so that it only sends data back from new sims.


Without knowing what the harm is in sending back data from sims it has already visited, why not just let your receiver handle this? Since people can terraform sims at any time, it might actually be useful for the satellite to update its data on sims it has already visited. You can leave it up to your receiver to determine if it wants to keep the new data or throw it out. Just a thought.
Dan Medici
Registered User
Join date: 25 Jan 2004
Posts: 132
11-29-2004 19:08
I've considered that, but the receiver has too much data that it is already handling and would probably run out of memory as well with a 100+ array of simulator names. :( I got it to work with my normal satellite now though.