Can someone post an example of the code an object script would execute to find its current memory usage? Is that possible presently?
Also, are there constraints on memory usage for scripts currently?
Can someone post an example of the code an object script would execute to find its current memory usage? Is that possible presently?
Also, are there constraints on memory usage for scripts currently?
There's one in the examples
Oops. Forgot about that one. Thanks.
Although that's a pretty wacky mechanism. The event reports an enumeration that amounts to Warning, Low, Critical, or Limit. There is no overt measurement associated. This may be good in some ways, but it can represent a moving goalpost over time, too, making good scripts become bad ones in the future.
I wonder what it would mean to report the "Limit" level. Would your script have already crashed? Or does the engine carry on, even if the script is past its limit?
https://help.sansar.com/hc/en-us/articles/115001996766-MemoryUseLevel
just create a simple script with a List of strings in it that adds one to it every so many milliseconds, then report the memory limit every 60 seconds and find out
When memory limits are enforced they will be "temporally fuzzy": there will be some time to "fix" memory use before steps are taken. How much time will depend on how egregious the memory use is and how fast it filled up.
I did some tests of the existing mechanism:
https://help.sansar.com/hc/en-us/community/posts/115009690606-Testing-MemoryUseLevel
I'm a bit concerned about memory constraints and what's currently reported by the Memory.Subscribe() method. If the current Policy Limit of 10 megs was real and enforced right now, this would paint a very gloomy picture moving forward.
https://gyazo.com/31283546c2c0b7fa153e2970896f015a
Something is very fishy here. There are only 5 dynamic objects in this scene.
Continually sitting idle as a carry out from the last graph here is the current and peak memory usage reported by a very simple script in the floor. The memory usage has climbed to half a gigabyte now. So either there is just a simple counter in the implementation or there's a severe memory leak somewhere. And C# is supposed to have garbage collection, so is it the 5 dynamic objects that get calls into C++ (Havok) leaking? At this rate a virtually empty region would chew through about 12 gigabytes in a day.
So I sat predominately idle til this point. I suspect at this moment it went to fetch another half gig of memory and crashed. That's About 2.5 hours of life.
How are you getting peak memory usage?
Peak Memory is in the same place as Memory in the data structure.
And Aojashin noticed the doubling per double time!
Here's the full graph start til crash.
So this is bizarre, but the solution is don't check the memory and it won't leak LOL
It seems to be like watching a pot to boil.
Maybe the subscribe itself IS the leak? *bangs head against wall*
Wild
Move to bug report.
Confirmed by staying logged in with only the subscription call.
So the leak is hysterically in the query of how much memory is available.
Could you share the script you are using for your testing? I definitely want to track down any leaks there before enabling memory limits.
hah! last time I shared a script with you you forced my hand on storing the AgentPrivate in a list. (well played)
So first I will go strip out anything that isn't needed for this purpose and then re-test it and then send it
Well well, upon stripping everything else out I am seeing new behaviors. Still some minor leakage, but this prelim test is not on a clean region, so I'll go do that first and report back.
I am a firm believer in isolating variable down to get to the root cause, and it doesn't look like I fully did in the first tests, though I sure thought I had.
Reminds me of the time me and a colleague chased a wild pointer down for 8 hours and it ended up miles away from where it was doing the damage.
I knew I wasn't losing my mind
Wait for it......