Replies: 3 comments 8 replies
-
The single function of your code is not enough to form an idea of what may be happening or not. What's bad depends on the flow of the code all the way. Unsurprisingly, a memory leak with berry object count only going up is pretty bad, and indeed likely to cause major failure, but debugging of that depends on more than the function you posted, and how it is even used. You should not read a lot into whatever you get in "load average", as this is not at all an average load 😀 |
Beta Was this translation helpful? Give feedback.
-
Well as mentioned, if I run the script without altering the animation, it's fine, hence the part where I change the animation in the berry script causes the leak to happen. Why it does that I don't know, first time Berry user, have some programming skills, but I an definitely not a wizzkid 😉 So I am assuming that re-calling the animation class over and over causes it to happen. As mentioned, I just took the animation example from the Berry part of Tasmot's docs.. |
Beta Was this translation helpful? Give feedback.
-
Did you manage to reproduce it with the above code? One thing I thought about, since it is easy to change the colours and brightness without redefining the object, would it be possible to add the speed/duration to be configurable during run-time? i.e
|
Beta Was this translation helpful? Give feedback.
-
I am finding my way into Berry Scripting, and I am using a script that makes a driver and uses the 'every_1s' loop to check an analog input, and according to that value play an animation on a ws2812 ring (used the berry example script) and also put some info on the Web UI.
What I noticed is that when running the script, the load average goes from '19' to '99' and stays around there, with about 234 berry objects. But then when the animation starts, it keeps on increasing the Berry Objects, and the load avg gets higher and higher. At a certain point the module looses its wifi connection, and only a reset will get it back online.
Not sure if it is some bad coding, but inside the 1_sec loop I only check the analog every 10sec. and change color and restart the animation as follows;
Anything I am doing incorrect?
Beta Was this translation helpful? Give feedback.
All reactions