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 9 potential issue(s) across 3 detector type(s):
| Severity |
Count |
| 🔴 High |
7 |
| 🟡 Medium |
1 |
| 🟢 Low (improvement opportunity) |
1 |
| Detector |
Count |
Severity |
Description |
FragmentViewFieldRetentionLeak |
7 |
🔴 High |
Fragment stores View references in instance fields not cleared in onDestroyView() |
ServiceResourceManagementIssueDetector |
1 |
🟡 Medium |
Service may never stop — missing stopSelf() call |
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 — ChannelFragment
Fragment View Field Retention Leak Detected
Class: org.schabi.newpipe.fragments.list.channel.ChannelFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() does not clear all View fields
Leaked Fields:
• binding : org.schabi.newpipe.databinding.FragmentChannelBinding (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 — SelectPlaylistFragment
Fragment View Field Retention Leak Detected
Class: org.schabi.newpipe.settings.SelectPlaylistFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• progressBar : android.widget.ProgressBar (assigned in onCreateView)
• recyclerView : androidx.recyclerview.widget.RecyclerView (assigned in onCreateView)
• emptyView : 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/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
progressBar = null;
recyclerView = null;
emptyView = null;
}
Finding #3 — SelectChannelFragment
Fragment View Field Retention Leak Detected
Class: org.schabi.newpipe.settings.SelectChannelFragment
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)
• progressBar : android.widget.ProgressBar (assigned in onCreateView)
• emptyView : 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/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
recyclerView = null;
progressBar = null;
emptyView = null;
}
Finding #4 — PreferenceSearchFragment
Fragment View Field Retention Leak Detected
Class: org.schabi.newpipe.settings.preferencesearch.PreferenceSearchFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : org.schabi.newpipe.databinding.SettingsPreferencesearchFragmentBinding (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 — BaseDescriptionFragment
Fragment View Field Retention Leak Detected
Class: org.schabi.newpipe.fragments.detail.BaseDescriptionFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : org.schabi.newpipe.databinding.FragmentDescriptionBinding (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 — PlaylistAppendDialog
Fragment View Field Retention Leak Detected
Class: org.schabi.newpipe.local.dialog.PlaylistAppendDialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() does not clear all View fields
Leaked Fields:
• playlistDuplicateIndicator : android.widget.TextView (assigned in onViewCreated)
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();
playlistDuplicateIndicator = null;
}
Finding #7 — MissionsFragment
Fragment View Field Retention Leak Detected
Class: us.shandian.giga.ui.fragment.MissionsFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• mEmpty : android.view.View (assigned in onCreateView)
• mList : 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();
mEmpty = null;
mList = null;
}
🟡 ServiceResourceManagementIssueDetector
Service may never stop — missing stopSelf() call
Finding #8 — DownloadManagerService
⚠� Service may never stop. Consider calling stopSelf() when work is complete.
Class: us.shandian.giga.service.DownloadManagerService
Method: onStartCommand
🟢 ViewBindingOpportunity
Manual findViewById() calls — ViewBinding migration opportunity
Finding #9 — ToolbarActivity
View Binding Migration Opportunity
Class: us.shandian.giga.ui.common.ToolbarActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• 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 NewPipe.
LeakScope: Android Lifecycle & Memory Leak Violations
Summary
LeakScope detected 9 potential issue(s) across 3 detector type(s):
FragmentViewFieldRetentionLeakServiceResourceManagementIssueDetectorViewBindingOpportunityDetailed Findings
🔴
FragmentViewFieldRetentionLeakFragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 —
ChannelFragmentFinding #2 —
SelectPlaylistFragmentFinding #3 —
SelectChannelFragmentFinding #4 —
PreferenceSearchFragmentFinding #5 —
BaseDescriptionFragmentFinding #6 —
PlaylistAppendDialogFinding #7 —
MissionsFragment🟡
ServiceResourceManagementIssueDetectorService may never stop — missing stopSelf() call
Finding #8 —
DownloadManagerService🟢
ViewBindingOpportunityManual findViewById() calls — ViewBinding migration opportunity
Finding #9 —
ToolbarActivityHow 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 NewPipe.