Sitting Lightcloud
Registered User
Join date: 13 May 2004
Posts: 109
|
08-12-2004 22:59
Ok, I think this used to work but maybe I'm overlooking something... Why doesn't the memory I use in the list get available to the script after clearing the list? Is there a way to make it? is it a time, stack, heap issue?
default { state_entry() { list test; integer i; integer lc=0; for (i=0;i<10000;i++) { test+=["The rain in Spain stays mainly in the plain"]; if (llGetFreeMemory()<2000) { llSay(0,"Remember..." + (string) llGetFreeMemory()); test=[]; llSay(0,"Now we have " + (string) llGetListLength(test)); lc++; if (lc>5) return; } } } }
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
08-13-2004 00:48
For one, your not using proper CODE forum tags  Secondly, you didnt post exactly what your object said after running this script. What happened? Did a Stack-Heap Collision occur? Did the return value of llGetFreeMemory decline gradually? Did your object burst into flames and start attacking you? I ran the script in-world, and this is what I got: From: someone Object: Remember...1978 Object: Now we have 0 Object: Remember...1978 Object: Now we have 0 Object: Remember...1978 Object: Now we have 0 Object: Remember...1978 Object: Now we have 0 Object: Remember...1978 Object: Now we have 0 Object: Remember...1978 Object: Now we have 0 Im not sure what you're trying to say here... According to your code (and the output above), your object only says the amount of memory available after that amount is less then 2000, it makes sence, since you're clearing the list every time, to get the same value here. ==Chris
|
Grim Lupis
Dark Wolf
Join date: 11 Jul 2003
Posts: 762
|
08-13-2004 06:47
There's a leak somewhere, Chris, although this code may not represent it well.
I have a script that uses two lists, one of keys and one of strings. Whenever free memory drops below a certain level, I email the list of strings to an RL server, and reset the list. If, after resetting, the free memory is still below a certain level, I also reset the key list.
Somewhere in the process I'm not getting back my memory from one or both of the lists. I've gotten to the point now where I just call llResetScript() after sending the email message, to force a memory cleanup.
_____________________
Grim
"God only made a few perfect heads, the rest of them he put hair on." -- Unknown
|
Sitting Lightcloud
Registered User
Join date: 13 May 2004
Posts: 109
|
08-13-2004 17:10
Sorry for the code forum tags, had no idea there was any but anyway, what I tried to explain was that the memory should be released after clearing the list. I know it used to do that before. Now there is no point in using llGetFreeMemory() to check how much memory is left unless you reset the script or notify the owner that the script will soon crash. But I guess the only options is to reset the script. With other words, if I have a list that takes up 4Kb when I clear that list I would expect to get my 4kb back. I also checked with a string and it works the same way it doesn't get released back to the script. And I know it was just a simple script to show that the memory doesn't get returned back to the script but it was 1 AM but if anyone know another way of releasing it without reseting the script I'd be much ablidged  Thanks 
|