Page 1 of 1

Question about CPU overload and extensions.

Posted: 25 Feb 2010, 03:24
by mistermind
Hello there,
We are on the final stages of our newest expansion and currently at the "stress test".
Our CPU hits 100% every 10 to 16 hours forcing me to restart SFS. When I do, CPU gets back to normal and the process starts all over again. My first clue to what could be going wrong is our server extension, programmed in AS/Javascript containing over 5000 lines of code.
Although huge, its well spread between hundreds of methods and doesn't seem to have any visible issues with the AS compiler (ASCompilerOptimizationLevel is at 9 and game seems to run very smooth).

I got 3 questions (sorry some of them will sound a little newbie, but I'm a newbie on memory and CPU usage):

- Is it possible to have a debugger analyze how many objects (or even extension instances) are active in the server so I can pin point who exactly is overloading the CPU?

- When an extension is loaded there are about 100 numeric constants that are declared upon creation, but I figured I don't have to issue a delete command on them since the extension unloads itself once the room is destroyed. What is the behavior of constants on AS/Javascript extensions?

- Of course, at beta phase we are running into several bugs each day. What happens to an extension when it encounter a bug? Does it get stuck on memory forever until I boot SFS or does the extension instance gets destroyed?
(Some of them even include unrelated type of variable as JSON translates into this:)

Code: Select all

Wrapped net.sf.json.JSONException: JSON does not allow non-finite numbers ( Internal: -219 -- Line number:  (MainLib line: 1264)

Posted: 25 Feb 2010, 19:11
by mistermind
CPU overload resolved:
- Turned out to be a sequence of events that would lead into an infinite function call loop. If one client would trigger that sequence, the server would then get stuck in a single loop that consumed the entire CPU in a matter of hours.

But still, now just out of curiosity and if anyone knows, the answers for questions 2 and 3 =)