directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaspar Luethi <kas...@humantools.ch>
Subject Re: [MINA] Apparent DEADLOCK in com.mchange.v2.async.ThreadPoolAsynchronousRunner
Date Wed, 11 Jan 2006 17:18:40 GMT
>How can I do to free ByteBuffers much more as possible ?
>With 2000 opened IoSessions I have about 312 Mb of ram busy.

312/2000 = 156 KB/user, not too much. java is very memory hungry.

i only have small bytebuffers (<4k) and with 500 users, the server
consumes about 80MB (linux).

i also tested for memory leaks with a profiler, and i must confess
there were many, mostly improperly released JDBC resources.

there is the danger in java-garbage-collection, that the programmer
relies too much on the runtime system to clean up the memory.

developing long-running application needs you to take an extra care
for that kind of problems. another example on my suse linux testserver,
MySQL closes all connections after 8 hours.


>When I receive chat messages I see memory occupation to grow...Is
>there some natural mina
>activity I'm losing during reading/writing operations ?

i think memory occupation grows when *sending* the chat messages
back to the users. even if you send a single message, if you send
them to 2000 users, the single message will get copied into 2000
mina byte buffers. that's why i still miss ByteBuffer.duplicate() in
mina. it was probably made just for that kind of situation.

mina-experts, please correct me if i am wrong about the copying.

kaspar
-- 
---------------------------------------------
  http://www.humantools.com

Mime
View raw message