LeakCanary 1.6 🐤

Py ⚔
Py ⚔
Jul 24, 2018 · 2 min read

We just released a new version of LeakCanary, and it’s got several new features!

Heads up, we’ve moved! If you’d like to continue keeping up with the latest technical content from Square please visit us at our new home https://developer.squareup.com/blog

Image for post
Image for post
Update your build.gradle

Highlight of the leak cause

We also simplified the leak trace UI and added in context help.

Image for post
Image for post
This leak was caused by either MainActivity.httpRequestHelper or HttpRequestHelper.button

The leak analysis runs in a foreground service

We also turned off computation of the retained heap size by default, to reduce the analysis time.

Image for post
Image for post
Analysis in progress

Leak detection in UI tests

LeakCanary runs at the end of every UI test and reports a test failure if a leak is detected.

Image for post
Image for post
UI Test failure in Square POS, the leak cause is in red.

To set it up, see Running LeakCanary in instrumentation tests.

Reporting traces to a crash backend

Image for post
Image for post
replay(1).autoConnect() caused a leak

To set it up, see Uploading to a server.

Update LeakCanary

Square Corner Blog

Buying and selling sound like simple things - and they…

Py ⚔

Written by

Py ⚔

Android baker @Square. Twitter account: @Piwai

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Py ⚔

Written by

Py ⚔

Android baker @Square. Twitter account: @Piwai

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store