简体   繁体   English

此转储中netty正常的内存使用情况?

[英]the memory usage of netty normal in this dump?

for 13K users I have the following memory dump. 对于13K用户,我有以下内存转储。 I will paste the top 7 consumers. 我将粘贴前7位消费者。 Netty seems to consume too much memory. Netty似乎消耗过多的内存。 Is this normal ? 这正常吗?

(Netty Version:3.2.7, implementing IdleStateAwareChannelUpstreamHandler,Total Memory Netty Memory Usage:2.5GB minimum ) (Netty版本:3.2.7,实现IdleStateAwareChannelUpstreamHandler,总内存Netty内存使用量:最小2.5GB)

 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 这是有关Netty内部存储器使用情况的一些事实

  • One channel has two ReentrantLocks , (one read lock,one write lock) 一个通道有两个ReentrantLocks ,(一个读锁,一个写锁)

  • 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). Channel将所有通道引用存储在org.jboss.netty.util.internal.ConcurrentHashMap内部,并在关闭时自动删除(这是分配唯一的通道ID)。

  • ChannelGroup stores channel references in a org.jboss.netty.util.internal.ConcurrentHashMap on add() and automatically removes on close. ChannelGroup在add()上将频道引用存储在org.jboss.netty.util.internal.ConcurrentHashMap ,并在关闭时自动删除。

  • There will be one ConcurrentHashMap$HashEntry per item stored in org.jboss.netty.util.internal.ConcurrentHashMap . 存储在org.jboss.netty.util.internal.ConcurrentHashMap每个项目将有一个ConcurrentHashMap$HashEntry

so you can calculate the expected memory usage, if your handlers are not leaking any references. 因此,如果您的处理程序没有泄漏任何引用,则可以计算预期的内存使用量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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