-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
内存泄漏 #28
Comments
好的,非常感谢。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Subscriber类中的take方法被interrupt异常拦截时需要再标记下interrupt,否则线程无法正常结束导致越来越多,最终结果就可能内存溢出
protected byte[] take()
{
byte[] data = null;
try
{
synchronized (lock)
{
while (messages.isEmpty())
{
lock.wait(100);
if (this.isInterrupted()) return null;
}
data = messages.removeFirst();
}
return data;
}
catch(Exception ex)
{
this.interrupt(); //需加入
return null;
}
}
The text was updated successfully, but these errors were encountered: