Jump to content
You are about to reply to a thread that has been inactive for 805 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

There's no limit to the size of a list, but you can certainly overflow the memory limit for your script by stuffing too much data into a list. The way to avoid that is to monitor llGetFreeMemory and then panic when it gets too low. 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
On 5/25/2020 at 10:54 PM, Rolig Loon said:

There's no limit to the size of a list, but you can certainly overflow the memory limit for your script by stuffing too much data into a list. The way to avoid that is to monitor llGetFreeMemory and then panic when it gets too low. 

default{
     state_entry(){
                            integer fm = llGetFreeMemory();
                            if (fm < 1024){
                                                      state panic;
                            }
     } // state_entry
} // default

state panic{
     state_entry(){
                              llAttemptGarbageCollection();
                              llFreakOut();
                              llHaltAndCatchFire();
                            }
}

Here because I had this exact list limit question.

There's also this, where LepreKhaun 'splains that the 64k limit has some flexibility under mono:

 

Link to comment
Share on other sites

Don't force garbage collections unless you have to. They're slow. The idea is to wait until it looks like you're running out of memory, then force a GC and recheck before taking other actions to avoid running out of memory. Unless you have a script which really can do something useful when nearly out of memory, don't force a GC.

A good use would be a greeter script that kept track of recent visitors. If llGetFreeMemory indicates it is close to running out of memory, it should remove the oldest entries.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 805 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...