MyCATApache / Mycat-Server

GNU General Public License v2.0
9.5k stars 3.85k forks source link

io.mycat.statistic.stat.UserSqlLastStat$SqlLast 内存泄露 #2882

Open goudai opened 2 years ago

goudai commented 2 years ago

1、bug描述 num #instances #bytes class name

1: 2250864 1482129608 [C 2: 24391474 975658960 io.mycat.statistic.stat.UserSqlLastStat$SqlLast 3: 24396011 585504264 java.util.concurrent.ConcurrentSkipListMap$Node 4: 24194852 580676448 java.lang.String 5: 12193201 292636824 java.util.concurrent.ConcurrentSkipListMap$Index 6: 2242 7967664 [B 7: 262144 6291456 org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapper 8: 4482 1288136 [Ljava.lang.Object; 9: 35264 1128448 io.mycat.statistic.HeartbeatRecorder$Record 10: 1524 1122328 [I 11: 35630 855120 java.util.concurrent.ConcurrentLinkedQueue$Node 12: 10001 720072 net.sf.ehcache.Element 13: 10000 720000 io.mycat.route.RouteResultset 14: 10000 720000 io.mycat.route.RouteResultsetNode 15: 10969 526512 java.util.HashMap 16: 4271 479496 java.lang.Class 17: 10000 400000 net.sf.ehcache.store.chm.SelectableConcurrentHashMap$HashEntry 18: 20156 322496 java.lang.Integer 19: 10001 320032 net.sf.ehcache.DefaultElementEvictionData 20: 10000 240000 [Lio.mycat.route.RouteResultsetNode; 21: 4520 216960 io.mycat.statistic.SQLRecord 22: 4785 153120 java.util.concurrent.ConcurrentHashMap$Node 23: 384 151552 [Lnet.sf.ehcache.store.chm.SelectableConcurrentHashMap$HashEntry; 24: 3190 102080 java.util.HashMap$Node 25: 1047 95680 [Ljava.util.HashMap$Node; 26: 2100 84000 java.util.LinkedHashMap$Entry 27: 1 80536 [Ljava.lang.Integer; 28: 830 73040 java.lang.reflect.Method 29: 4386 70176 java.lang.Object

2、版本号(非常重要) BuildTime 2016-10-28 12:47:06 GitVersion 460930bb32b0007597796369bc92daa8428d8787 MavenVersion 1.6-RELEASE

junwen12221 commented 2 years ago

这个问题好像已经修复了

https://github.com/MyCATApache/Mycat-Server/commit/8bf6c7751f9ac374ee66445f1ac5894f25ff6ea8

junwen12221 commented 2 years ago

另外也可以关闭sql统计避免这个问题

goudai commented 2 years ago

如何关闭sql统计呀

junwen12221 commented 2 years ago

<property name="useSqlStat">0</property>