Skip to content

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

Description

@fushen0

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;
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions