CATROID-376: Integrate LeakCanary for Memory Leak Detection#5184
Open
harshsomankar123-tech wants to merge 1 commit intoCatrobat:developfrom
Open
CATROID-376: Integrate LeakCanary for Memory Leak Detection#5184harshsomankar123-tech wants to merge 1 commit intoCatrobat:developfrom
harshsomankar123-tech wants to merge 1 commit intoCatrobat:developfrom
Conversation
- build.gradle: Add LeakCanary 2.14 as debugImplementation - CatrobatServerCalls.kt: Migrate to Okio 2.x extension functions
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



JIRA TICKET - https://catrobat.atlassian.net/browse/CATROID-376
Overview
This PR integrates LeakCanary 2.14 into the project to automatically detect and help resolve memory leaks during development. LeakCanary identifies leaks in Activities, Fragments, ViewModels, and other objects, providing detailed leak traces via system notifications.
Changes Made
catroid/build.gradle): Addedcom.squareup.leakcanary:leakcanary-android:2.14usingdebugImplementation. This ensures the library is only included in debug builds and has no impact on the release APK size or performance.CatrobatServerCalls.kt): LeakCanary 2.14 transitively upgrades Okio from version 1.x to 2.x. This required updatingCatrobatServerCalls.ktto use Okio 2.x Kotlin extension functions (destination.sink().buffer()) instead of the deprecated static methods (Okio.buffer(Okio.sink(destination))).Verification Results
./gradlew catroid:dependenciesthat LeakCanary is completely excluded from the release classpath.How to use
Once a debug build is installed, LeakCanary will automatically monitor for leaks. If a leak is detected, a notification will appear. Tapping it will open the LeakCanary dashboard with a complete "leak trace" showing the path from a GC Root to the leaked object.
Your checklist for this pull request
Please review the contributing guidelines and wiki pages of this repository.