LeakScope: Android Lifecycle & Memory Leak Violations
About this report: This issue was automatically generated by LeakScope, a static analysis tool for Android lifecycle violations and memory leaks built on the Soot framework. This is part of an ongoing academic research study targeting ICSE 2027. No immediate action is required — we would greatly appreciate your feedback on whether these findings are accurate.
Summary
LeakScope detected 8 potential issue(s) across 2 detector type(s):
| Severity |
Count |
| 🔴 High |
2 |
| 🟡 Medium |
0 |
| 🟢 Low (improvement opportunity) |
6 |
| Detector |
Count |
Severity |
Description |
FragmentViewFieldRetentionLeak |
2 |
🔴 High |
Fragment stores View references in instance fields not cleared in onDestroyView() |
ViewBindingOpportunity |
6 |
🟢 Low |
Manual findViewById() calls — ViewBinding migration opportunity |
Detailed Findings
🔴 FragmentViewFieldRetentionLeak
Fragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 — ProfileFragment
Fragment View Field Retention Leak Detected
Class: com.example.easychat.ProfileFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• profilePic : android.widget.ImageView (assigned in onCreateView)
• usernameInput : android.widget.EditText (assigned in onCreateView)
• phoneInput : android.widget.EditText (assigned in onCreateView)
• updateProfileBtn : android.widget.Button (assigned in onCreateView)
• progressBar : android.widget.ProgressBar (assigned in onCreateView)
• logoutBtn : android.widget.TextView (assigned in onCreateView)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/B
… (truncated for brevity)
Finding #2 — ChatFragment
Fragment View Field Retention Leak Detected
Class: com.example.easychat.ChatFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• recyclerView : androidx.recyclerview.widget.RecyclerView (assigned in onCreateView)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
recyclerView = null;
}
🟢 ViewBindingOpportunity
Manual findViewById() calls — ViewBinding migration opportunity
Finding #3 — SearchUserActivity
View Binding Migration Opportunity
Class: com.example.easychat.SearchUserActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak
Finding #4 — MainActivity
View Binding Migration Opportunity
Class: com.example.easychat.MainActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in onCreate
• findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak
Finding #5 — ChatActivity
View Binding Migration Opportunity
Class: com.example.easychat.ChatActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak
Finding #6 — LoginOtpActivity
View Binding Migration Opportunity
Class: com.example.easychat.LoginOtpActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak
Finding #7 — LoginPhoneNumberActivity
View Binding Migration Opportunity
Class: com.example.easychat.LoginPhoneNumberActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak
Finding #8 — LoginUsernameActivity
View Binding Migration Opportunity
Class: com.example.easychat.LoginUsernameActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in onCreate
• findViewById in onCreate
• findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak
How to respond to this issue:
- If a finding is a true positive: consider applying the recommended fix and closing this issue.
- If a finding is a false positive: please leave a comment explaining why — your feedback directly improves our research.
- If you have questions: reply here or open a discussion.
This report was generated by LeakScope as part of the ICSE 2027 research artifact. Tool analyzes compiled APKs using Soot static analysis on Android_Chat_Application.
LeakScope: Android Lifecycle & Memory Leak Violations
Summary
LeakScope detected 8 potential issue(s) across 2 detector type(s):
FragmentViewFieldRetentionLeakViewBindingOpportunityDetailed Findings
🔴
FragmentViewFieldRetentionLeakFragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 —
ProfileFragmentFinding #2 —
ChatFragment🟢
ViewBindingOpportunityManual findViewById() calls — ViewBinding migration opportunity
Finding #3 —
SearchUserActivityFinding #4 —
MainActivityFinding #5 —
ChatActivityFinding #6 —
LoginOtpActivityFinding #7 —
LoginPhoneNumberActivityFinding #8 —
LoginUsernameActivityHow to respond to this issue:
This report was generated by LeakScope as part of the ICSE 2027 research artifact. Tool analyzes compiled APKs using Soot static analysis on Android_Chat_Application.