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 3 detector type(s):
| Severity |
Count |
| 🔴 High |
7 |
| 🟡 Medium |
0 |
| 🟢 Low (improvement opportunity) |
1 |
| Detector |
Count |
Severity |
Description |
FragmentViewFieldRetentionLeak |
6 |
🔴 High |
Fragment stores View references in instance fields not cleared in onDestroyView() |
ThreadedUIReference |
1 |
🔴 High |
Worker thread captures Activity/Fragment/View reference |
ViewBindingOpportunity |
1 |
🟢 Low |
Manual findViewById() calls — ViewBinding migration opportunity |
Detailed Findings
🔴 FragmentViewFieldRetentionLeak
Fragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 — AnalogClockSettingsFragment
Fragment View Field Retention Leak Detected
Class: com.fazziclay.opentoday.gui.fragment.settings.AnalogClockSettingsFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : com.fazziclay.opentoday.databinding.FragmentSettingsAnalogClockBinding (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();
binding = null;
}
Finding #2 — ItemNotificationFragment
Fragment View Field Retention Leak Detected
Class: com.fazziclay.opentoday.gui.fragment.ItemNotificationFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : com.fazziclay.opentoday.databinding.DialogItemNotificationBinding (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();
binding = null;
}
Finding #3 — DeveloperFragment
Fragment View Field Retention Leak Detected
Class: com.fazziclay.opentoday.gui.fragment.DeveloperFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : com.fazziclay.opentoday.databinding.FragmentDeveloperBinding (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();
binding = null;
}
Finding #4 — DeleteItemsFragment
Fragment View Field Retention Leak Detected
Class: com.fazziclay.opentoday.gui.fragment.DeleteItemsFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : com.fazziclay.opentoday.databinding.FragmentDeleteItemsBinding (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();
binding = null;
}
Finding #5 — ItemTextEditorFragment
Fragment View Field Retention Leak Detected
Class: com.fazziclay.opentoday.gui.fragment.ItemTextEditorFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : com.fazziclay.opentoday.databinding.FragmentItemTextEditorBinding (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();
binding = null;
}
Finding #6 — ImportFragment
Fragment View Field Retention Leak Detected
Class: com.fazziclay.opentoday.gui.fragment.ImportFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : com.fazziclay.opentoday.databinding.FragmentImportBinding (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();
binding = null;
}
🔴 ThreadedUIReference
Worker thread captures Activity/Fragment/View reference
Finding #7 — ImportFragment\n// (Full source code omitted for brevity)\n"
{
"text_input": "package com.fazziclay.opentoday.gui.fragment;\n\n// Class: com.fazziclay.opentoday.gui.fragment.ImportFragment\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "opentoday",
"explanation": "Scenario 1: Worker thread holds UI object reference\nClass: com.fazziclay.opentoday.gui.fragment.ImportFragment\nMethod: void importNetwork(java.lang.String)\nStatement: r6 \u003d new java.lang.Thread\nCaptured UI objects:\n - r2 : android.app.Dialog\n - r0 : com.fazziclay.opentoday.gui.fragment.ImportFragment\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
"text_input": "package com.fazziclay.opentoday.gui.fragment;\n\n// Class: com.fazziclay.opentoday.gui.fragment.ImportFragment\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "opentoday",
"explanation": "Scenario 1: Worker thread holds UI object reference\nClass: com.fazz
… (truncated for brevity)
🟢 ViewBindingOpportunity
Manual findViewById() calls — ViewBinding migration opportunity
Finding #8 — CrashReportActivity
View Binding Migration Opportunity
Class: com.fazziclay.opentoday.gui.activity.CrashReportActivity
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 OpenToday.
LeakScope: Android Lifecycle & Memory Leak Violations
Summary
LeakScope detected 8 potential issue(s) across 3 detector type(s):
FragmentViewFieldRetentionLeakThreadedUIReferenceViewBindingOpportunityDetailed Findings
🔴
FragmentViewFieldRetentionLeakFragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 —
AnalogClockSettingsFragmentFinding #2 —
ItemNotificationFragmentFinding #3 —
DeveloperFragmentFinding #4 —
DeleteItemsFragmentFinding #5 —
ItemTextEditorFragmentFinding #6 —
ImportFragment🔴
ThreadedUIReferenceWorker thread captures Activity/Fragment/View reference
Finding #7 —
ImportFragment\n// (Full source code omitted for brevity)\n"🟢
ViewBindingOpportunityManual findViewById() calls — ViewBinding migration opportunity
Finding #8 —
CrashReportActivityHow 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 OpenToday.