Moderator: Phades
danvath wrote:Still working on it, but it sounds like we need to have a fail safe for when pathfinder = null, so if pathfinder = null then make the character move by clicking on the edge of the screen to move there, then check for trees again. This way it keeps looking around until it finds one.
Do you know what happens when the memory leak takes effect? The memory leak may just be the fact that pathfinder = null so it keeps running the script to look for a tree, but fails and starts looking again and again.
danvath wrote:Usually a memory leak is some part of the code that is getting called in a never ending loop. Each time it is called it takes up some of the memory address. So say you had
if(i !< 4)
but i never has the ability to ever get below 4, then you have a memory leak because it will continusly run without termination.
Another thing that can cause this is from resources not being cleared after they are gone. I think C# and Java both have their own garbage collection so it should not happen in these bots.
How do you know that there is even a memory leak in the first place?
First time actually loading up this client, and see that I have 15FPS...
danvath wrote:Usually a memory leak is some part of the code that is getting called in a never ending loop.
ashwolf wrote:I saved the chop and collect files as: chop.groovy and collect.groovy
Now the problem is when I typ :bot chop or :bot collect it does nothing at all. What am I doing wrong?
All it says is immediately 'script FINISHED'
mvgulik wrote:danvath wrote:Usually a memory leak is some part of the code that is getting called in a never ending loop.
Erm. The loop part only make a memory leak nicely detectable.
Memory leak: Something or some action is using some resources that are never released again. (this can be anything, from bug in internal Client or Groovy base code to bad user groovy coding ... like (example) constantly opening a file whiteout ever closing it/them.)
Users browsing this forum: Yandex [Bot] and 3 guests