Memory leak in ViewPositionHolder
See original GitHub issueIt seem there is a memory leak when using GestureViews
.
ViewPositionAnimator
contains a fromPosHolder
and a toPosHolder
. But toPosHolder.clear()
is never called. As such, view.getViewTreeObserver().removeOnPreDrawListener
is never called, and the OnPreDrawListener
keep a reference to the GestureView
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Understanding Memory Leaks in Java - Baeldung
A Memory Leak is a situation where there are objects present in the heap that are no longer used, but the garbage collector...
Read more >Hunting Java Memory Leaks - Toptal
In this post, I'll explain how and why memory leaks occur in Java and outline an approach for detecting such leaks with the...
Read more >Mystery Memory Leak: Where Did My Memory Go?!
This blog addresses how to troubleshoot unaccounted memory usage or leak to include identifying and data collection. If you already determined ...
Read more >Find a Memory Leak | dotMemory Documentation - JetBrains
In this tutorial, we'll see how you can use dotMemory to locate and fix memory leaks in your apps. But before moving on,...
Read more >How to Detect Memory Leaks in Java: Causes, Types, & Tools
A memory leak is a situation where unused objects occupy unnecessary space in memory. Unused objects are typically removed by the Java ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, I think I understand the problem better now, but I’ll need to think about a proper fix, since just calling
.clear()
ontoPosHolder
may not solve it for 100%.As of your fix, it may work as it is for you, but it will not detect the source view (
GestureView
) position changes if they’ll ever happen. It is not a very common use case, so you may not experience it in your app.Sorry everybody for the long wait, I finally added a fix for this memory leak. I did some testing from my side but I need you verify if the issue is gone for you in version 2.7.1 now.