el uso de memoria de netty normal en este volcado?

for 13K users I have the following memory dump. I will paste the top 7 consumers. Netty seems to consume too much memory. Is this normal ?

(Netty Version:3.2.7, implementing IdleStateAwareChannelUpstreamHandler,Total Memory Netty Memory Usage:2.5GB minimum )

 num     #instances         #bytes  class name
----------------------------------------------
   1:      23086640      923465600  org.jboss.netty.util.internal.ConcurrentHashMap$Segment
   2:      28649817      916794144  java.util.concurrent.locks.ReentrantLock$NonfairSync
   3:      23086640      554864352  [Lorg.jboss.netty.util.internal.ConcurrentHashMap$HashEntry;
   4:        118907      275209504  [I
   5:       5184704      207388160  java.util.concurrent.ConcurrentHashMap$Segment
   6:       5184704      130874832  [Ljava.util.concurrent.ConcurrentHashMap$HashEntry;
   7:       1442915      115433200  [Lorg.jboss.netty.util.internal.ConcurrentHashMap$Segment;

preguntado el 09 de marzo de 12 a las 15:03

That does sound like a lot. Are you sure all resources are cleaned when a user disconnects? -

the only references that I am keeping is for Channel, ChannelGroup object. Should I do something special after user disconnects ? Because my User (keeps references for Channel, ChannelGroup istances) instance count is identical with the concurrent user count. -

I would check whether you get this much memory usage after 13,000 user connect, but don't disconnect. Or you get this usage only after users disconnect and re-connect many times. -

there may be misunderstanding: 4.4GB is the total memory usage. The numbers above indicates that Netty using 2.5GB minimum. By the way do i have to consider some facts while cleaning resources (special for netty) ? -

dumped using this command :jmap -histo:live <pid> -

1 Respuestas

It looks like the memory usage is not normal.

Here are some facts about Netty internal memory usage

  • One channel has two ReentrantLocks, (one read lock,one write lock)

  • Channel stores all channel references in a org.jboss.netty.util.internal.ConcurrentHashMap internally, and automatically removes on close (This is to assign unique channel ids).

  • ChannelGroup stores channel references in a org.jboss.netty.util.internal.ConcurrentHashMap on add() and automatically removes on close.

  • Habrá uno ConcurrentHashMap$HashEntry per item stored in org.jboss.netty.util.internal.ConcurrentHashMap.

so you can calculate the expected memory usage, if your handlers are not leaking any references.

respondido 10 mar '12, 09:03

can i say that Channel objects are not released after disconnect - Gusano

found a leak that is causing netty objects not to be garbage collected. currently heap size is only 200MB for 10K users. which seems to be good. - Gusano

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.