okhttps icon indicating copy to clipboard operation
okhttps copied to clipboard

Android使用stomp 3.1.3会产生内存泄漏

Open fushen0 opened this issue 11 months ago • 1 comments

stomp版本:3.1.3 LeakCanary报内存泄漏,报错信息: GC Root:input or output parameters in native code

java.util.TaskQueue instance Leaking: UNKONWN Retaining 528 B in 2 objects TaskQueue.queue
java.util.TimerTask[] array Leaking: UNKONWN Retaining 512 B in 1 objects TimerTask[0] com.ejlchina.stomp.Stomp$1 instance Leaking: UNKONWN Retaining 5.0 MB in 10907 objects Anonymous subclass of java.util.TimerTask Stomp$1.this$this$0 com.ejlchina.stomp.Stomp instance Leaking: UNKONWN Retaining 5.0 MB in 10905 objects Stomp.onConnected

有在onDestory方法中释放,但是无用,ondestory方法中调用了stopWS: private void stopWS() { if (stomp != null ) { stomp.disconnect(); stomp.untopic(subscribeUrl); stomp = null; } }

fushen0 avatar Feb 14 '25 09:02 fushen0

10905 objects 都是什么类的对象,能提供下详细信息吗,或者把你的使用代码提供一下

troyzhxu avatar Mar 11 '25 01:03 troyzhxu