简体   繁体   中英

the memory usage of netty normal in this dump?

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;

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.

  • There will be one 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM