Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0.13
-
None
-
None
Description
In an old project, a RpcClient using mina 2.0.13 version has a memory leak. After investigation, it was found that many NioProcessor and NioSocketConnector were not recycled, and the number of threads was continuously increasing (the traffic did not increase).
Below is the RpcClient code used in the project. After reading, I also found some problems:
new RpcClient3().start();
1.session close is not right
RpcClient#close() future.getSession().close(false); // this future is ConnectFuture,not CloseFuture futureUInterrupt = future.awaitUninterruptibly(CONNECTOR_WORKER_TIMEOUT);
2.RpcClient#close has concurrent calls
1.RpcClient#startHealthCheck 2.RpcClient#activateConnectionSensor
But I still can't reproduce this problem, My leader want to locate the problem as much as possible before trying on the prod environment, such as updating the version, modifying session close to future.getSession().close(true) and wait().
ps: The heap.prof file cannot be uploaded as it exceeds 60MB. this is a google drive link: https://drive.google.com/file/d/14UBnhAF-7sdfYJsh7FMfKxx-dm0BqU9t/view?usp=drive_link