Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

[BUG] Memory leaks in OreoAutofillService #1356

@msfjarvis

Description

@msfjarvis

Describe the bug

OreoAutofillService constantly leaks memory in the background.

To Reproduce
Steps to reproduce the behavior:

  1. Enable Autofill
  2. Launch a website to a login form and attempt to fill it in
  3. Observe LeakCanary notification saying an object leaked.

Expected behavior

No memory leaks

Device information (please complete the following information):

  • Device: Google Pixel 4a
  • OS: Android 11
  • App version: 2.0.0-SNAPSHOT

Additional context

Here's the leak trace:

┬───
│ GC Root: Global variable in native code
│
├─ android.service.autofill.AutofillService$1 instance
│    Leaking: UNKNOWN
│    Retaining 2.0 kB in 15 objects
│    Anonymous subclass of android.service.autofill.IAutoFillService$Stub
│    this$0 instance of dev.msfjarvis.aps.util.services.OreoAutofillService
│    ↓ AutofillService$1.this$0
│                        ~~~~~~
╰→ dev.msfjarvis.aps.util.services.OreoAutofillService instance
​     Leaking: YES (ObjectWatcher was watching this because dev.msfjarvis.aps.
​     util.services.OreoAutofillService received Service#onDestroy() callback)
​     Retaining 1.4 kB in 14 objects
​     key = 77ea4a3f-ebd3-4805-9296-0b99bbbcdc89
​     watchDurationMillis = 32544
​     retainedDurationMillis = 27506
​     mApplication instance of dev.msfjarvis.aps.Application
​     mBase instance of android.app.ContextImpl

METADATA

Build.VERSION.SDK_INT: 30
Build.MANUFACTURER: Google
LeakCanary version: 2.6
App process name: dev.msfjarvis.aps
Stats: LruCache[maxSize=3000,hits=2067,misses=72796,hitRate=2%]
RandomAccess[bytes=3515060,reads=72796,travel=29562220372,range=20995498,size=26
704589]
Heap dump reason: 1 retained objects, app is not visible
Analysis duration: 2463 ms

Metadata

Metadata

Labels

A-autofillArea: AutofillC-bugCategory: This is a bugP-lowPriority: low

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions