Possible Memory leak through FinalizerReference

前端 未结 2 1091
说谎
说谎 2021-01-17 10:06

I have a small android app and I tried looking for memory leaks, so I clicked \'Dump Java Heap\' and the first class on the list is FinalizerReference (java.lang.ref). It ha

2条回答
  •  忘掉有多难
    2021-01-17 10:31

    There is likely no memory leak involving FinalizerReference in your app, although the Android Memory Profiler makes it look like there is.

    My investigation of similar concerns convinced me that Profiler performs massive multiple counting of the same small amount of memory in the case of FinalizerReference, so that the reported value of Retained Memory is meaningless, and sometimes even ludicrous.

    In your case, the ~38kB Shallow Size is important, but small, while the ~40 MB Retained Memory should be ignored.

提交回复
热议问题