Home | Search | Login | RSS
We have 1079 members and counting!
Next Page

1

Previous Page

Thread: FMS memory question, please help me

Created on: 02/05/10 05:48 PM

Replies: 1

yuchai





Joined: 02/05/10

Posts: 4

FMS memory question, please help me
02/05/10 5:48 PM

I use FMS development webgame. 2 application. 1: room 2: game.
room to maintain 24-hour continuous connection. game is the player number 0, shutdown ()

That there are about 400 people online when the room occupied by the memory 500-800M. game only 100M +
Players reduction, room memory will not reduce still remain in the 500-800M

Is there relevant solutions or comments?


//
//
//
//
function userLogon(_newClient, userType, userName, userPsd) {
var Logon = new LoadVars();
Logon.errorCount = 0;
Logon.onLoad = function(success) {
if (success) {
//trace("---------------------------");
if (this.returnInfo == "ok") {
application.acceptConnection(_newClient);
} else {
var err = new Object();
err.message = "error";
application.rejectConnection(_newClient, err);
}
} else {
this.errorCount++;
if (this.errorCount>=3) {
trace("error");
var err = new Object();
err.message = "error";
application.rejectConnection(_newClient, err);
} else {
Logon.sendAndLoad(sendUrl, Logon, "POST");
}
}
};
var sendUrl = logonUrl+"userName="+userName+"&userPsd="+userPsd+"&";
//trace("logonURL="+sendUrl);
Logon.sendAndLoad(sendUrl, Logon, "POST");
}
//
//
//
The above is my with. Net code for examples of interactive programs.
sendandload in the "function" . To do an asynchronous callback. Used many times in such a way, such as sending data, user exit, replace the image and so on ... I have used this method
Is it because such an approach lead to memory footprint is too large?

Link | Top | Bottom

VincentMeens





Joined: 02/01/10

Posts: 33

RE: FMS memory question, please help me
02/06/10 4:53 AM

Hello Yuchai,


first of all, your description is hard to figure out, so here's my interpretation: "Whenever clients disconnect no memory is released, so in time my memory is filled up".


I don't know the exact details but from my experience with other languages it probably has to do with the so called garbage collector (which is responsible for clearing up memory after a variable or something isn't used anymore). I don't know for sure but probably the data you use doesn't get released untill the application shuts down on the server side.


Depending on your data interaction, for instance you use a non-persistent (in memory) shared object to handle all communication and data between the clients. In that case you probably should explicitly delete all variables related to the client upon that client disconnecting, and thus releasing the allocated space in memory. If you don't, the shared object keeps growing as you describe, because the garbage collector doesn't know if the variables are still needed in the future or not and thus keeps them in memory.

Link | Top | Bottom

Next Page

1

Previous Page

New Post

Please login to post a response.