-
Notifications
You must be signed in to change notification settings - Fork 590
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
内存占用 #324
Comments
以TcpSession为例,是不是缺少一个Flush方法 |
我看了源代码,断开后注销Session代码 如下, /// <summary>
/// Unregister session by Id
/// </summary>
/// <param name="id">Session Id</param>
internal void UnregisterSession(Guid id)
{
// Unregister session by Id
Sessions.TryRemove(id, out TcpSession _);
} 按你说的没有释放 ,可以改成 /// <summary>
/// Unregister session by Id
/// </summary>
/// <param name="id">Session Id</param>
internal void UnregisterSession(Guid id)
{
// Unregister session by Id
Sessions.TryRemove(id, out TcpSession tcpSession);
if (tcpSession!=null) {
if (tcpSession.IsDisposed == false) {
tcpSession.Dispose();
}
tcpSession = null;
}
} |
还有一点可以减少内存,使用int 代码long ,int占用4个byte,long占用8个byte。而且使用tcp传输文件也不会超800M,足够用了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
是不是缺少释放内存,当并发量跟请求体过大,应用占用的内存会居高不下
The text was updated successfully, but these errors were encountered: