Last updated 4 years ago
Was this helpful?
案例: for select包含default子句时, 可能造成内存泄露,
for select
default
当select的case为写操作时,刚好该channel缓冲区满,发生阻塞时,没写进去,会执行default,此时没写进去的那个变量将被丢弃,被垃圾回收器回收
select
case