Giter Club home page Giter Club logo

Comments (3)

pyricau avatar pyricau commented on June 9, 2024

This is really surprising. ObjectWatcher.expectWeaklyReachable does have a lock but I don't see what could be talking so long, especially as the ANR seems to be stuck on computing the hashcode of a string that represents a UUID.

is there a way to disable and not install all watchers in the release build

Yes, you can do that in various ways:

  • Pass the right (or empty) set of watchers to AppWatcher.manualInstall() (check the docs)
  • Leverage the interface that ObjectWatcher implements: ReachabilityWatcher and then use a fake impl in release builds

If you want a no-op in prod, your best bet is to simply create an interface similar to ReachabilityWatcher, and in prod you have a no-op impl and you don't include the object-watcher dependency. In debug you include it and you have an impl that delegates to `ObjectWatcher.

from leakcanary.

pyricau avatar pyricau commented on June 9, 2024

I changed the impl to use a ConcurrentHashMap in 3.x so at least there won't be any locking in the future. Beyond that, I really have no idea what's happening here.

from leakcanary.

dimsuz avatar dimsuz commented on June 9, 2024

We are not able to reproduce it locally either. It seems there are always some really "strange" devices out there in the world :)

Thank you for the pointers on how to substitute a fake impl. I will try a simple upgrade to 3.0 version first though.

from leakcanary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.