MultiUser Server

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MultiUser Server

Lee Sylvester
Hey Nicolas,

I've got my multiuser server example working a treat for my project, but
when I check the memory usage, it increases with each connection, but
doesn't decrease with disconnections. Is this because the sockets remain
in a pool?  I'm using the ThreadRemotingServer, and from the examples,
none explicitly cleanup after a socket in the handled clientDisconnected
method.

Thanks,
Lee



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: MultiUser Server

Nicolas Cannasse
Lee McColl Sylvester a écrit :
> Hey Nicolas,
>
> I've got my multiuser server example working a treat for my project, but
> when I check the memory usage, it increases with each connection, but
> doesn't decrease with disconnections. Is this because the sockets remain
> in a pool?  I'm using the ThreadRemotingServer, and from the examples,
> none explicitly cleanup after a socket in the handled clientDisconnected
> method.

This is a normal GC behavior. It will reach some amount of memory (maybe
~50MB) and then will no move anymore since it will reuse space.

To be sure of that, you can try to connect+disconnect in a loop, and if
you reach 200MB and more then it means you indeed have a leak somewhere.

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: MultiUser Server

Lee Sylvester
Thanks Nicolas, that's a good idea.

I'll keep you posted ;-)

Lee


Nicolas Cannasse wrote:

> Lee McColl Sylvester a écrit :
>> Hey Nicolas,
>>
>> I've got my multiuser server example working a treat for my project,
>> but when I check the memory usage, it increases with each connection,
>> but doesn't decrease with disconnections. Is this because the sockets
>> remain in a pool?  I'm using the ThreadRemotingServer, and from the
>> examples, none explicitly cleanup after a socket in the handled
>> clientDisconnected method.
>
> This is a normal GC behavior. It will reach some amount of memory
> (maybe ~50MB) and then will no move anymore since it will reuse space.
>
> To be sure of that, you can try to connect+disconnect in a loop, and
> if you reach 200MB and more then it means you indeed have a leak
> somewhere.
>
> Nicolas
>


--
haXe - an open source web programming language
http://haxe.org