2021-02-18 16:17:58.399 io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 2781194413, max: 2793406464) 2021-02-18 16:17:58.399 at io.netty.util.internal.PlatformDependent.incrementMemoryCounter(PlatformDependent.java:725) ~[netty-all-4.1...
Netty依赖于ByteBuf管理直接内存,但ByteBuf的引用由JVM管理,当ByteBuf引用置为空,但实际申请的直接内存未释放就会导致直接内存溢出; 从提示中定位到org.littleshoot.proxy.impl.ClientToProxyConnection.copy方法;查询Github LittleProxy的issue,也有小伙伴遇到同样的问题,参考他的实现,不返回copy,而是直接返回original试试...
Caused by: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 4194304 byte(s) of direct memory (used: 2055208967, max: 2058354688) at io.netty.util.internal.PlatformDependent.incrementMemoryCounter(PlatformDependent.java:806) at io.netty.util.internal.PlatformDependent.allocateDirectNoClean...