volcengine / volc-sdk-java

Apache License 2.0
49 stars 32 forks source link

频繁调用RtcServiceImpl.getInstance()会导致线程泄露? #4

Open ThisMyWord opened 2 years ago

ThisMyWord commented 2 years ago

创建了很多守护线程没有释放

liuchu commented 2 years ago

同样遇到此问题。

getInstance()的实现是new一个新对象,是否不太合理?单例返回是不是更好的选择?

ThisMyWord commented 2 years ago

用新版本可以解决这个问题

cnbolin commented 2 years ago

使用1.0.63最新tag,依旧存在此问题,关键代码: com.volcengine.service.BaseServiceImpl. 构造器中: this.httpClient = HttpClientFactory.create(new ClientConfiguration(), null);

create 内部每次都new Thread()

Thread deamonThread = new Thread(new IdleConnectionMonitorThread(connectionManager)); deamonThread.setDaemon(true); deamonThread.start();

zhouwanga commented 1 year ago

需要手动销毁来着吧

ChiruMori commented 2 months ago

同样问题,会导致服务OOM,README 中有说明,按示例的写会有问题