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 (gameStats.as#1264) Internal: -219 -- Line number: (MainLib line: 1264)