# leakcanary

Published articles for leakcanary.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Testing LeakCanary 3 heap-growth detection with the Slack Android app

DevFeed: [Testing LeakCanary 3 heap-growth detection with the Slack Android app](<https://devfeed.tech/articles/cutting-some-slack-for-leaks-and-giggles-25621.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/cutting-some-slack-for-leaks-and-giggles>)

Author: Pierre-Yves Ricau

Published: 2024-05-07T00:47:25Z

Content type: tutorial

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Emulator](<https://devfeed.tech/topics/emulator.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [app](<https://devfeed.tech/tags/app.md>), [article](<https://devfeed.tech/tags/article.md>), [droidcon](<https://devfeed.tech/tags/droidcon.md>), [emulator](<https://devfeed.tech/tags/emulator.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [performance](<https://devfeed.tech/tags/performance.md>), [slack](<https://devfeed.tech/tags/slack.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

The article describes a preview LeakCanary 3 toolkit that detects heap growth by comparing repeated heap dumps and tracking objects with increasingly many outgoing edges. It explains how to run the tool against the Slack Android app using an emulator and UI Automator, but the supplied text ends before the results are presented.

### Source excerpt

In this article I run the new LeakCanary toolkit against the Slack Android app. Read on to learn a bunch! A new LeakCanary toolkit In two months, I will give a talk at Droidcon SF: Cutting Edges: universal heap trimming with LeakCanary 3 At Square, ...

## Avoid Java double brace initialization

DevFeed: [Avoid Java double brace initialization](<https://devfeed.tech/articles/avoid-java-double-brace-initialization-25619.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/avoid-java-double-brace-initialization>)

Author: Pierre-Yves Ricau

Published: 2023-06-27T20:58:00Z

Content type: tutorial

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [crash-reporting](<https://devfeed.tech/tags/crash-reporting.md>), [gc](<https://devfeed.tech/tags/gc.md>), [global](<https://devfeed.tech/tags/global.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [java](<https://devfeed.tech/tags/java.md>), [leak](<https://devfeed.tech/tags/leak.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [memory](<https://devfeed.tech/tags/memory.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [object](<https://devfeed.tech/tags/object.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

### AI overview

This tutorial explains how Java double brace initialization can cause memory leaks. An anonymous HashMap subclass implicitly retains its outer Activity, so a breadcrumb stored by a singleton BugSnag client can keep a destroyed Android Activity in memory. The article recommends avoiding the pattern and using explicit initialization or Kotlin.

### Source excerpt

TL;DR Avoid doing this: new HashMap() {{ put("key", value); }}; Leak Trace I was recently looking at the following leak trace from LeakCanary: ┬─── │ GC Root: Global variable in native code │ ├─ com.bugsnag.android.AnrPlugin instan...

## Callback leaks: cancel your Picasso requests!

DevFeed: [Callback leaks: cancel your Picasso requests!](<https://devfeed.tech/articles/callback-leaks-cancel-your-picasso-requests-25620.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/callback-leaks-cancel-your-picasso-requests>)

Author: Pierre-Yves Ricau

Published: 2023-01-17T21:06:14Z

Content type: tutorial

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [Picasso](<https://devfeed.tech/topics/picasso.md>), [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [leak](<https://devfeed.tech/tags/leak.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [performance](<https://devfeed.tech/tags/performance.md>), [picasso](<https://devfeed.tech/tags/picasso.md>)

### AI overview

This article investigates an Android memory leak caused by an in-flight Picasso image-loading request retaining a detached UI component through a custom callback. It explains how to read the leak trace and recommends canceling requests or using tags when the UI goes away.

### Source excerpt

👋 Hi, this is P.Y., I work as an Android Engineer at Block. Every month I organize an internal Ensemble Leak Hunting session where we look at the top leaks reported by LeakCanary to learn how to read

## Investigating Slow Android CI Heap Analysis on API 23 Emulators

DevFeed: [Investigating Slow Android CI Heap Analysis on API 23 Emulators](<https://devfeed.tech/articles/of-sharks-and-heaps-of-sticky-marshmallows-25627.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/of-sharks-and-heaps-of-sticky-marshmallows>)

Author: Pierre-Yves Ricau

Published: 2022-04-07T19:57:56Z

Content type: article

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [test](<https://devfeed.tech/topics/test.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [ci](<https://devfeed.tech/tags/ci.md>), [deep-dive](<https://devfeed.tech/tags/deep-dive.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [memory](<https://devfeed.tech/tags/memory.md>), [perfetto](<https://devfeed.tech/tags/perfetto.md>), [performance](<https://devfeed.tech/tags/performance.md>), [trace](<https://devfeed.tech/tags/trace.md>)

### AI overview

This deep-dive investigates why Android CI heap analysis occasionally took several minutes on API 23 emulators. The author reproduces the issue locally, uses tracing and heap dumps, and examines unexpectedly numerous sticky-class GC roots in Shark, LeakCanary's heap dump parser.

### Source excerpt

👋 Hi, this is P.Y., I work as an Android Engineer at Block, the rockey company formerly known as Square. I spend a lot of time focusing on performance and try to share my experience with deep-dive bl

## Leak detection: Android Studio vs LeakCanary ⚔

DevFeed: [Leak detection: Android Studio vs LeakCanary ⚔](<https://devfeed.tech/articles/leak-detection-android-studio-vs-leakcanary-25861.md>)

Original publisher: [Read original article](<https://dev.to/pyricau/leak-detection-android-studio-vs-leakcanary-35j5>)

Author: Py ⚔

Published: 2020-10-30T00:13:40Z

Content type: tutorial

Language: en

Sources: [Py ⚔](<https://devfeed.tech/sources/py.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [coding](<https://devfeed.tech/tags/coding.md>), [community](<https://devfeed.tech/tags/community.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [false-positive](<https://devfeed.tech/tags/false-positive.md>), [inclusive](<https://devfeed.tech/tags/inclusive.md>), [leak](<https://devfeed.tech/tags/leak.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [memory](<https://devfeed.tech/tags/memory.md>), [memory-leaks](<https://devfeed.tech/tags/memory-leaks.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

The article compares Android Studio's Activity/Fragment leak filtering with LeakCanary's lifecycle-based detection. It explains that Android Studio may flag newly created or cached Fragments as potential leaks, while LeakCanary watches destroyed objects and checks whether they remain retained after garbage collection.

### Source excerpt

I recently came across this comment in a post: The thing really annoying about LeakCanary or Android Studio, most of the time leaks identified by LeakCanary do not appear in Profiler/Memory/memory leaks, I wonder if LeakCanary is showing false positives or Android Studio is missing positives. That's a good question, let's dig into code and figure this out! False positive leaks in Android Studio Before answering the question, we need to talk about where the idea of false positive leaks comes from: Android Studio. That warning was originally a longer description: Activity and Fragment instances that might be causing memory leaks. For Activities, these are instances that have been destroyed but are still being referenced. For Fragments, these are instances that do not have a valid FragmentManager but are still being referenced. Note, these instance might include Fragments that were created but are not yet being utilized. The documentation provides more insights on false positive leaks: In certain situations, such as the following, the filter might yield false positives: A Fragment is created but has not yet been used. A Fragment is being cached but not as part of a FragmentTransaction. The phrasing is vague but it looks like false positive leaks only applies to Fragments. Android Studio leak filtering Android Studio dumps and analyzes the heap when you press the Dump Heap icon. Leaking instances are displayed by enabling the "Activity/Fragment Leaks" filter, which updates the bottom panel to only show leaking instances. The filtering is performed by ActivityFragmentLeakInstanceFilter: const val FRAGFMENT_MANAGER_FIELD_NAME = "mFragmentManager" /** * A Fragment instance is determined to be potentially leaked if * its mFragmentManager field is null. This indicates that the * instance is in its initial state. Note that this can mean that * the instance has been destroyed, or just starting to be * initialized but before being attached to an activity. The * latter gives us

## The real size of Android objects 📏

DevFeed: [The real size of Android objects 📏](<https://devfeed.tech/articles/the-real-size-of-android-objects-25864.md>)

Original publisher: [Read original article](<https://dev.to/pyricau/the-real-size-of-android-objects-1i2e>)

Author: Py ⚔

Published: 2020-09-22T22:31:08Z

Content type: tutorial

Language: en

Sources: [Py ⚔](<https://devfeed.tech/sources/py.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Java](<https://devfeed.tech/topics/java.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [coding](<https://devfeed.tech/tags/coding.md>), [community](<https://devfeed.tech/tags/community.md>), [deep-dive](<https://devfeed.tech/tags/deep-dive.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [inclusive](<https://devfeed.tech/tags/inclusive.md>), [java](<https://devfeed.tech/tags/java.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [memory](<https://devfeed.tech/tags/memory.md>), [performance](<https://devfeed.tech/tags/performance.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

The article investigates why Android and other heap-dump tools report different shallow object sizes. It explains that Java virtual machines use different memory layouts and that HPROF instance sizes are independent of VM layout and padding. Because JOL does not run on Dalvik or ART, the author explores using ART TI and its GetObjectSize API for LeakCanary.

### Source excerpt

Header image: Deep Dive by Romain Guy. I'm currently reimplementing how LeakCanary computes the retained heap size of objects. As a quick reminder: Shallow heap size of an object: The object size in the memory. Retained heap size of an object: The shallow size of that object plus the shallow size of all the objects that are transitively held in memory by only that object. In other words, it's the amount of memory that will be freed when that object is garbage collected. One cannot trust a shallow size As part of that work, I compared the shallow size of objects as reported in LeakCanary versus other heap dump tools such as YourKit, Eclipse Memory Analyzer Tool (MAT) and Android Studio Memory Analyzer. That's when I realized something was wrong: every tool provides a different answer. I asked Jesse Wilson about it and he pointed me to this article by Aleksey Shipilёv: What Heap Dumps Are Lying To You About. Some take aways: Every Java VM lays out its memory in a slightly different way and performs various optimizations, such as changing field order, aligning bits, etc. The heap dump format (.hprof) is a standard. A class dump record contains the list of fields and their types as well as the instance size of the class. Aleksey Shipilёv asked about having the instance size be the actual size of an instance in memory but the answer was nope: the sizes in the HPROF dump are VM and padding independent, to avoid breaking expectations from consuming tools. There's a tool called JOL that instruments the JVM runtime to report the actual size of an object. Aleksey used that to compare the size reported in hprof based tools with the actual size and found that they were all wrong in a different way. In Exploring Java's Hidden Costs, Jake Wharton showed how to use JOL. Unfortunately, JOL only runs on JVMs, and not the Dalvik or ART runtimes. To quote Jake: In this case, because the classes are exactly the same and the JVM 64 bit, and Android's now 64 bit, the number should be tra

## Investigating Memory Leaks in Square POS on Android Q

DevFeed: [Investigating Memory Leaks in Square POS on Android Q](<https://devfeed.tech/articles/story-of-an-android-q-leak-attachment-crazy-town-15896.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/story-of-an-android-q-leak-attachment-crazy-town>)

Author: P-Y Ricau

Published: 2019-07-03T19:00:00Z

Content type: article

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [Large Screen](<https://devfeed.tech/topics/large-screen.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [leak](<https://devfeed.tech/tags/leak.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [memory](<https://devfeed.tech/tags/memory.md>), [memory-leaks](<https://devfeed.tech/tags/memory-leaks.md>), [view](<https://devfeed.tech/tags/view.md>)

### AI overview

The article investigates unusually high memory leaks observed while testing Square POS on Android Q, focusing on leak traces involving an attached view and a destroyed activity. It also explains how LeakCanary 2 uses lifecycle heuristics when interpreting such traces.

### Source excerpt

Debugging leaks for Square POS in Android Q

## Handling configuration changes using static references

DevFeed: [Handling configuration changes using static references](<https://devfeed.tech/articles/handling-configuration-changes-using-static-references-39025.md>)

Original publisher: [Read original article](<https://vladimirj.dev/handling-configuration-changes/>)

Author: Vladimir Jovanović

Published: 2017-10-09T10:44:00Z

Content type: tutorial

Language: en

Sources: [Vladimir Jovanović](<https://devfeed.tech/sources/vladimir-jovanovic.md>)

Topics: [configuration](<https://devfeed.tech/topics/configuration.md>), [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [application](<https://devfeed.tech/tags/application.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [crash](<https://devfeed.tech/tags/crash.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [memory](<https://devfeed.tech/tags/memory.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [memory-management](<https://devfeed.tech/tags/memory-management.md>), [os](<https://devfeed.tech/tags/os.md>), [rotation](<https://devfeed.tech/tags/rotation.md>)

### AI overview

This Android article explains why using static references to preserve data across Activity configuration changes is unsafe. Such references can prevent the operating system from reclaiming memory, eventually causing the application to be killed and crash.

### Source excerpt

What if you hold a static reference to the data in my Activity to preserve them on screen rotation? Why is that bad?

## Android leak pattern: subscriptions in views

DevFeed: [Android leak pattern: subscriptions in views](<https://devfeed.tech/articles/android-leak-pattern-subscriptions-in-views-15503.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/android-leak-pattern-subscriptions-in-views>)

Author: P-Y Ricau

Published: 2016-09-20T00:55:57Z

Content type: tutorial

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [debug](<https://devfeed.tech/topics/debug.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [memory-leaks](<https://devfeed.tech/tags/memory-leaks.md>)

### AI overview

This article explains how subscriptions held by Android views can cause memory leaks when they are not unsubscribed. It examines a case where relying on view attachment and detachment callbacks failed because an inflated view hierarchy was never attached before the activity finished.

### Source excerpt

Avoid memory leaks by properly handling view subscriptions

## Streamlining Android Apps Tech Talks

DevFeed: [Streamlining Android Apps Tech Talks](<https://devfeed.tech/articles/streamlining-android-apps-tech-talks-15897.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/streamlining-android-apps-tech-talks>)

Author: Square Engineering

Published: 2015-08-24T16:09:00Z

Content type: news

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-apps](<https://devfeed.tech/tags/android-apps.md>), [channel](<https://devfeed.tech/tags/channel.md>), [code](<https://devfeed.tech/tags/code.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [talks](<https://devfeed.tech/tags/talks.md>), [youtube](<https://devfeed.tech/tags/youtube.md>)

### AI overview

Square announces that recordings of its "Streamlining Android Apps" tech talks are available on the Square Engineering YouTube channel. The presentations cover eliminating code overhead and LeakCanary.

### Source excerpt

Presentations on eliminating code overhead and LeakCanary.

## Alert dialogs may cause memory leaks in Android apps before Lollipop

DevFeed: [Alert dialogs may cause memory leaks in Android apps before Lollipop](<https://devfeed.tech/articles/a-small-leak-will-sink-a-great-ship-15476.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/a-small-leak-will-sink-a-great-ship>)

Author: P-Y Ricau

Published: 2015-08-20T16:09:00Z

Content type: article

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [Android](<https://devfeed.tech/topics/android.md>), [bug](<https://devfeed.tech/topics/bug.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [dialog](<https://devfeed.tech/tags/dialog.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [memory-leaks](<https://devfeed.tech/tags/memory-leaks.md>), [picasso](<https://devfeed.tech/tags/picasso.md>)

### AI overview

This article investigates memory leaks in Android apps before Android Lollipop. It traces the issue to alert-dialog click listeners and references retained by worker threads processing messages through blocking queues.

### Source excerpt

Prior to Android Lollipop, alert dialogs may cause memory leaks in your Android apps.

## Square Presents: Streamlining Android Apps

DevFeed: [Square Presents: Streamlining Android Apps](<https://devfeed.tech/articles/square-presents-streamlining-android-apps-15881.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/square-presents-streamlining-android-apps>)

Author: Square Engineering

Published: 2015-06-08T16:09:00Z

Content type: news

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [Code](<https://devfeed.tech/topics/code.md>), [Library](<https://devfeed.tech/topics/library.md>), [cpu](<https://devfeed.tech/topics/cpu.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [developer](<https://devfeed.tech/tags/developer.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [java](<https://devfeed.tech/tags/java.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [library](<https://devfeed.tech/tags/library.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [technical](<https://devfeed.tech/tags/technical.md>)

### AI overview

Square announces an Android-focused technical talk featuring Jake Wharton and Pierre-Yves Ricau. The event will cover reducing code overhead and CPU and memory usage, along with LeakCanary, Square's memory leak detection library for Android and Java. Square says LeakCanary reduced OutOfMemoryError crashes in Square Register for Android by 94% within a few weeks.

### Source excerpt

Technical talks featuring Jake Wharton and Pierre-Yves Ricau

## LeakCanary: Detecting memory leaks in Android and Java applications

DevFeed: [LeakCanary: Detecting memory leaks in Android and Java applications](<https://devfeed.tech/articles/leakcanary-detect-all-memory-leaks-15743.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/leakcanary-detect-all-memory-leaks>)

Author: P-Y Ricau

Published: 2015-05-08T16:08:00Z

Content type: article

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [Android](<https://devfeed.tech/topics/android.md>), [Java](<https://devfeed.tech/topics/java.md>), [Library](<https://devfeed.tech/topics/library.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [crash](<https://devfeed.tech/tags/crash.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [java](<https://devfeed.tech/tags/java.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [memory-leaks](<https://devfeed.tech/tags/memory-leaks.md>), [open-source](<https://devfeed.tech/tags/open-source.md>)

### AI overview

This article introduces LeakCanary, an open-source Java library for detecting memory leaks in debug builds. It explains how leaks can retain objects beyond their expected lifetimes, eventually causing OutOfMemoryError crashes, and outlines manual leak investigation steps.

### Source excerpt

A memory leak detection library for Android and Java.