leak_tracker icon indicating copy to clipboard operation
leak_tracker copied to clipboard

Enable leak tracking for release mode.

Open polina-c opened this issue 3 years ago • 18 comments

Subtasks:

  • [x] Make reachabilityBarrier (package dart:developer) available in release mode: https://github.com/itsjustkevin/sdk/commit/08b76a50fc138a94a5460f321500911b666eada1
  • [ ] Enable leak tracker for release mode.

If you are interested in leak tracking in release mode, please, upvote this issue and justify your case.

polina-c avatar Dec 13 '22 15:12 polina-c

I believe this would be very helpful for release builds as well, so people can upload their leaks to error reporting tools such as sentry.io and fix them. Similar to https://square.github.io/leakcanary/uploading/

marandaneto avatar Apr 01 '23 08:04 marandaneto

Could be useful for edge cases with special releases on beta channel. Would be good to add an enableInRelease flag.

noga-dev avatar Apr 01 '23 09:04 noga-dev

@a-siva and @bkonyi , thoughts?

polina-c avatar Apr 03 '23 19:04 polina-c

@a-siva and @bkonyi , thoughts

This is for flutter release builds I presume or is this request for command line Dart ?

a-siva avatar Apr 04 '23 00:04 a-siva

I assume this is for PRODUCT mode builds, which includes Flutter release. Given that this is basically a counter that we increment (even in PRODUCT mode, although it's not accessible) I think it's low-risk to expose this in PRODUCT mode. However, if this feature requires any sort of VM service connection to work properly then this won't be something we can do.

bkonyi avatar Apr 04 '23 14:04 bkonyi

Thanks. Yes, it is just counter. VM service connection is not needed as the diagnostics will be saved and analyzed offline. Can we plan implementing this? Should I transfer the issue to VM repo?

polina-c avatar Apr 04 '23 20:04 polina-c

I vote for it, if the performance drop is minimal in release mode. More sanity checks never do any harm (as long as they do not affect performance)!

fzyzcjy avatar May 31 '23 10:05 fzyzcjy

https://dart-review.googlesource.com/c/sdk/+/315981

a-siva avatar Jul 24 '23 18:07 a-siva

I vote for it, if the performance drop is minimal in release mode. More sanity checks never do any harm (as long as they do not affect performance)!

I agree with this comment.

ZhouC125 avatar Jul 30 '23 13:07 ZhouC125

The feature is unblocked, but not implemented yet, and not part of leak_tracker MVP. Reopening.

polina-c avatar Aug 14 '23 23:08 polina-c

The feature is unblocked, but not implemented yet, and not part of leak_tracker MVP. Reopening.

We have turned the reachability barrier on in product mode, why do you say it is not implemented yet?

a-siva avatar Aug 14 '23 23:08 a-siva

Issue title is 'Enable leak_tracker...'. I need to update leak_tracker

polina-c avatar Aug 15 '23 18:08 polina-c

@itsjustkevin, I am reopening the issue: while reachability barrier is now available in release mode (thank you!!!), leak tracker is still off for release mode.

polina-c avatar Aug 27 '23 16:08 polina-c

I do not think we should make this an option unless we have significant profiling data to support it.

In particular, we should have profiling data from a mid-tier Android device that shows this has little to no impact on frame/raster times. The profiling data we do have so far from macOS desktop applications suggests that it would.

dnfield avatar Jan 18 '24 00:01 dnfield

I do not think we should make this an option unless we have significant profiling data to support it.

In particular, we should have profiling data from a mid-tier Android device that shows this has little to no impact on frame/raster times. The profiling data we do have so far from macOS desktop applications suggests that it would.

I agree. Most likely in release mode leak analysis and reporting should happen not on timer, but on request from application, when application is known to be in stale state.

polina-c avatar Jan 18 '24 00:01 polina-c