Android-tcp-server-and-client icon indicating copy to clipboard operation
Android-tcp-server-and-client copied to clipboard

memory leak

Open D4n16l6 opened this issue 7 years ago • 0 comments

I have encountered a memory problem. Each time the connection is attempted, if it fails, there is a memory increment of 512KB that is never released. I tried various methods: cancel (true) in the AsyncTask when an exception is triggered in socketexception set tcpClient to null call System.gc () call TCPCommunicator.removeAllListerners () call TCPCommunicator.closeStreams () on different occasions in doInBackground SocketTimeoutException UnknownHostException IOException but every attempt has failed and memory continues to increase. Is there a way to release the class and clean the memory?

UPDATE: I tried to call Thread.currentThread.interrupt() but without luck.

D4n16l6 avatar Sep 07 '18 08:09 D4n16l6