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 46 potential issue(s) across 4 detector type(s):
| Severity |
Count |
| 🔴 High |
46 |
| 🟡 Medium |
0 |
| 🟢 Low (improvement opportunity) |
0 |
| Detector |
Count |
Severity |
Description |
FragmentViewFieldRetentionLeak |
28 |
🔴 High |
Fragment stores View references in instance fields not cleared in onDestroyView() |
StateHolderLeak |
16 |
🔴 High |
Static field holds UI/Context reference across configuration changes |
ThreadedUIReference |
1 |
🔴 High |
Worker thread captures Activity/Fragment/View reference |
ViewModelContextReference |
1 |
🔴 High |
ViewModel stores Activity/Context reference causing memory leak |
Detailed Findings
🔴 FragmentViewFieldRetentionLeak
Fragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 — LocationsBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.LocationsBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetListSelectionBinding (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 — InputBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.InputBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetInputBinding (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 — ShortcutsBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.ShortcutsBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetShortcutsBinding (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 — FeedbackBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.FeedbackBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetFeedbackBinding (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 — ProductsBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.ProductsBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetListSelectionBinding (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 — StoresBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.StoresBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetListSelectionBinding (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 #7 — ShoppingListClearBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.ShoppingListClearBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetShoppingListClearBinding (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 #8 — DateBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.DateBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetDateBinding (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 #9 — ProductGroupsBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.ProductGroupsBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetListSelectionBinding (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 #10 — LanguagesBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.LanguagesBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetListSelectionBinding (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 #11 — QuickModeConfirmBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.QuickModeConfirmBottomSheet
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 : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetScanModeConfirmBinding (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 #12 — ChoreEntryBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.ChoreEntryBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetChoreEntryBinding (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 #13 — TaskEntryBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.TaskEntryBottomSheet
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 : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetTaskEntryBinding (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 #14 — StockLocationsBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.StockLocationsBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetStockLocationsBinding (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 #15 — TextEditBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.TextEditBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetTextEditBinding (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 #16 — DrawerBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.DrawerBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetDrawerBinding (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 #17 — TaskCategoriesBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.TaskCategoriesBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetListSelectionBinding (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 #18 — CompatibilityBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.CompatibilityBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetCompatibilityBinding (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 #19 — QuantityUnitsBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.QuantityUnitsBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetListSelectionBinding (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 #20 — StockEntriesBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.StockEntriesBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetStockEntriesBinding (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 #21 — InputProductBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.InputProductBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetInputProductBinding (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 #22 — ShoppingListItemBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.ShoppingListItemBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetShoppingListItemBinding (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 #23 — StockEntryBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.StockEntryBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetStockEntryBinding (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 #24 — TextBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.TextBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetTextBinding (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 #25 — UsersBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.UsersBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetListSelectionBinding (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 #26 — ShoppingListsBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.ShoppingListsBottomSheet
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 : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetListSelectionBinding (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 #27 — BarcodeFormatsBottomSheet
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.BarcodeFormatsBottomSheet
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentBottomsheetBarcodeFormatsBinding (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 #28 — MealPlanPagingFragment
Fragment View Field Retention Leak Detected
Class: xyz.zedler.patrick.grocy.fragment.MealPlanPagingFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : xyz.zedler.patrick.grocy.databinding.FragmentMealPlanPagingBinding (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;
}
🔴 StateHolderLeak
Static field holds UI/Context reference across configuration changes
Finding #29 — MasterProductCatBarcodesEditViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductCatBarcodesEditViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductCatBarcodesEditFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #30 — MasterProductCatConversionsViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductCatConversionsViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #31 — TaskEntryEditViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.TaskEntryEditViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.TaskEntryEditFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #32 — RecipeEditIngredientListViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.RecipeEditIngredientListViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.RecipeEditIngredientListFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #33 — RecipeViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.RecipeViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.RecipeFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #34 — MasterProductViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #35 — MasterProductCatQuantityUnitViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductCatQuantityUnitViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductCatQuantityUnitFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #36 — RecipeEditViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.RecipeEditViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.RecipeEditFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #37 — MasterProductCatOptionalViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductCatOptionalViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductCatOptionalFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #38 — MasterProductCatAmountViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductCatAmountViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductCatAmountFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #39 — MasterProductCatLocationViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductCatLocationViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductCatLocationFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #40 — ShoppingListItemEditViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.ShoppingListItemEditViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.ShoppingListItemEditFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #41 — MasterProductCatConversionsEditViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductCatConversionsEditViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductCatConversionsEditFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #42 — MasterProductCatDueDateViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductCatDueDateViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductCatDueDateFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #43 — RecipeEditIngredientEditViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.RecipeEditIngredientEditViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.RecipeEditIngredientEditFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
Finding #44 — MasterProductCatBarcodesViewModel
Potential State Holder Memory Leak Detected
Class: xyz.zedler.patrick.grocy.viewmodel.MasterProductCatBarcodesViewModel
Issue: Scenario 1: ViewModel field 'args' of type 'xyz.zedler.patrick.grocy.fragment.MasterProductFragmentArgs' holds UI reference. ViewModel survives config changes but UI is recreated.
Fix: Use LiveData or StateFlow instead of holding UI references.
🔴 ThreadedUIReference
Worker thread captures Activity/Fragment/View reference
Finding #45 — LogFragment\n// (Full source code omitted for brevity)\n"
{
"text_input": "package xyz.zedler.patrick.grocy.fragment;\n\n// Class: xyz.zedler.patrick.grocy.fragment.LogFragment\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "patrick",
"explanation": "Scenario 1: Worker thread holds UI object reference\nClass: xyz.zedler.patrick.grocy.fragment.LogFragment\nMethod: void lambda$onViewCreated$2()\nStatement: $r1 \u003d new xyz.zedler.patrick.grocy.fragment.LogFragment$loadAsyncTask\nCaptured UI objects:\n - r0 : xyz.zedler.patrick.grocy.fragment.LogFragment\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 xyz.zedler.patrick.grocy.fragment;\n\n// Class: xyz.zedler.patrick.grocy.fragment.LogFragment\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "patrick",
"explanation": "Scenario 1: Worker thread holds UI object reference\nClass: xyz.zedler.patrick.grocy.fragment.
… (truncated for brevity)
🔴 ViewModelContextReference
ViewModel stores Activity/Context reference causing memory leak
Finding #46 — BaseViewModel
ViewModel Memory Leak Risk:
Class: xyz.zedler.patrick.grocy.viewmodel.BaseViewModel
Violation: Field 'resources' of type android.content.res.Resources in ViewModel
Recommendation: Remove direct references to UI-related or context-holding classes
ViewModel Memory Leak Risk:
Method: <init>
Class: xyz.zedler.patrick.grocy.viewmodel.BaseViewModel
Violation: Local variable of type android.content.res.Resources assigned in ViewModel method
Line: -1
Recommendation: Avoid storing UI or context references
Code Snippet: r0.<xyz.zedler.patrick.grocy.viewmodel.BaseViewModel: android.content.res.Resources resources> = $r6
Suspicious ViewModel Context Retrieval:
Method: lambda$showSnackbarWithDetailsAction$3
Invoked Method: getContext
Invoked Class: android.view.View
Recommendation: Avoid retrieving context directly in ViewModel
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 grocy-android.
LeakScope: Android Lifecycle & Memory Leak Violations
Summary
LeakScope detected 46 potential issue(s) across 4 detector type(s):
FragmentViewFieldRetentionLeakStateHolderLeakThreadedUIReferenceViewModelContextReferenceDetailed Findings
🔴
FragmentViewFieldRetentionLeakFragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 —
LocationsBottomSheetFinding #2 —
InputBottomSheetFinding #3 —
ShortcutsBottomSheetFinding #4 —
FeedbackBottomSheetFinding #5 —
ProductsBottomSheetFinding #6 —
StoresBottomSheetFinding #7 —
ShoppingListClearBottomSheetFinding #8 —
DateBottomSheetFinding #9 —
ProductGroupsBottomSheetFinding #10 —
LanguagesBottomSheetFinding #11 —
QuickModeConfirmBottomSheetFinding #12 —
ChoreEntryBottomSheetFinding #13 —
TaskEntryBottomSheetFinding #14 —
StockLocationsBottomSheetFinding #15 —
TextEditBottomSheetFinding #16 —
DrawerBottomSheetFinding #17 —
TaskCategoriesBottomSheetFinding #18 —
CompatibilityBottomSheetFinding #19 —
QuantityUnitsBottomSheetFinding #20 —
StockEntriesBottomSheetFinding #21 —
InputProductBottomSheetFinding #22 —
ShoppingListItemBottomSheetFinding #23 —
StockEntryBottomSheetFinding #24 —
TextBottomSheetFinding #25 —
UsersBottomSheetFinding #26 —
ShoppingListsBottomSheetFinding #27 —
BarcodeFormatsBottomSheetFinding #28 —
MealPlanPagingFragment🔴
StateHolderLeakStatic field holds UI/Context reference across configuration changes
Finding #29 —
MasterProductCatBarcodesEditViewModelFinding #30 —
MasterProductCatConversionsViewModelFinding #31 —
TaskEntryEditViewModelFinding #32 —
RecipeEditIngredientListViewModelFinding #33 —
RecipeViewModelFinding #34 —
MasterProductViewModelFinding #35 —
MasterProductCatQuantityUnitViewModelFinding #36 —
RecipeEditViewModelFinding #37 —
MasterProductCatOptionalViewModelFinding #38 —
MasterProductCatAmountViewModelFinding #39 —
MasterProductCatLocationViewModelFinding #40 —
ShoppingListItemEditViewModelFinding #41 —
MasterProductCatConversionsEditViewModelFinding #42 —
MasterProductCatDueDateViewModelFinding #43 —
RecipeEditIngredientEditViewModelFinding #44 —
MasterProductCatBarcodesViewModel🔴
ThreadedUIReferenceWorker thread captures Activity/Fragment/View reference
Finding #45 —
LogFragment\n// (Full source code omitted for brevity)\n"🔴
ViewModelContextReferenceViewModel stores Activity/Context reference causing memory leak
Finding #46 —
BaseViewModelHow 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 grocy-android.