Comments (3)
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.
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.
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)
- Use @RestrictTo
- Huawei P40Lite app launcher icon disappear HOT 1
- Better handling of CoroutineContext in traces
- App Crashing V3.0 alpha 1 HOT 1
- Support computing retained size for any object
- v2.13 App crash while monkey testing (java.lang.IllegalArgumentException: width and height must be > 0) HOT 1
- "Getting started" page accidentally pointing folks to alpha release
- HprofPrimitiveArrayStripper
- Remove the usages of WorkManager's SettableFuture HOT 3
- OnHprofRecordListener class description maybe have error
- I make a desktop app , which use shark library to analyze leakใyou can play itใ HOT 1
- ๐ [This issue will be immediately closed]
- Leak droid-org-repo-APPID
- Background ANR at ScreenOffTrigger BroadcastReceiver [leakcanary on release] HOT 1
- Updating from 2.14 to 3.0-alpha-2 yields no leak canary app HOT 3
- Documentation for LeakCanary and Shark APIs Return 404 Errors HOT 1
- Bugs when running application HOT 1
- Compose NavBackStackEntry leak HOT 2
- Crash with ViewModel 2.8 HOT 5
- Compose Only Based Navigation: View Model Leaks Not Auto Detected? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leakcanary.