[Bug 62633] WsSession leaks if cache Session are used for group sending

2018-08-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62633

--- Comment #3 from saiya <1005136...@qq.com> ---
(In reply to Mark Thomas from comment #1)
> The provided sample application does not demonstrate a memory leak in Apache
> Tomcat. WsSession objects are retained while the session is open and
> released once the session is closed.
> 
> The provided sample application does contain several memory leaks due to the
> failure to stop threads.

If I execute the following code in the onClose, I can solve it.

try {
Field wsFrame = WsSession.class.getDeclaredField("wsFrame");
wsFrame.setAccessible(true);
WsFrameServer wsFrameServer = (WsFrameServer)
wsFrame.get(wsSession);

Field socketWrapper =
WsFrameServer.class.getDeclaredField("socketWrapper");
socketWrapper.setAccessible(true);
SocketWrapperBase socketWrapperBase = (SocketWrapperBase)
socketWrapper.get(wsFrameServer);

Field endpoint =
SocketWrapperBase.class.getDeclaredField("endpoint");
endpoint.setAccessible(true);
AbstractEndpoint abstractEndpoint = (AbstractEndpoint)
endpoint.get(socketWrapperBase);
NioEndpoint nioEndpoint = (NioEndpoint)abstractEndpoint;

AbstractEndpoint.Handler handler = nioEndpoint.getHandler();
handler.release(socketWrapperBase);

} catch (IllegalAccessException | NoSuchFieldException e) {
e.printStackTrace();
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 62633] WsSession leaks if cache Session are used for group sending

2018-08-26 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62633

--- Comment #2 from saiya <1005136...@qq.com> ---
try {
Field wsFrame = WsSession.class.getDeclaredField("wsFrame");
wsFrame.setAccessible(true);
WsFrameServer wsFrameServer = (WsFrameServer)
wsFrame.get(wsSession);

Field socketWrapper =
WsFrameServer.class.getDeclaredField("socketWrapper");
socketWrapper.setAccessible(true);
SocketWrapperBase socketWrapperBase = (SocketWrapperBase)
socketWrapper.get(wsFrameServer);

Field endpoint =
SocketWrapperBase.class.getDeclaredField("endpoint");
endpoint.setAccessible(true);
AbstractEndpoint abstractEndpoint = (AbstractEndpoint)
endpoint.get(socketWrapperBase);
NioEndpoint nioEndpoint = (NioEndpoint)abstractEndpoint;

AbstractEndpoint.Handler handler = nioEndpoint.getHandler();
handler.release(socketWrapperBase);

} catch (IllegalAccessException | NoSuchFieldException e) {
e.printStackTrace();
}
This can be solved

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 62633] WsSession leaks if cache Session are used for group sending

2018-08-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62633

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 OS||All
 Resolution|--- |INVALID

--- Comment #1 from Mark Thomas  ---
The provided sample application does not demonstrate a memory leak in Apache
Tomcat. WsSession objects are retained while the session is open and released
once the session is closed.

The provided sample application does contain several memory leaks due to the
failure to stop threads.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org