question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory leak in ViewPositionHolder

See original GitHub issue

It 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:closed
  • Created 5 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
alexvasilkovcommented, Jan 16, 2019

Thanks, I think I understand the problem better now, but I’ll need to think about a proper fix, since just calling .clear() on toPosHolder 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.

2reactions
alexvasilkovcommented, Nov 24, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found