Skip to content

Memory leaks occur when an activity is destroyed and recreated. Android os #173770

@SJLBenjamin

Description

@SJLBenjamin

Note

For anyone looking at this issue now, this leak was introduced by 233edc0 in Flutter 3.29.

1.Create a Flutter project using Android Studio.

2.Enter the developer options, set not to keep activities, (destroy each activity as soon as the user leaves it)

3.Entering the activity, clicking the home button, exiting the activity, and then entering the activity again will trigger the destruction and reconstruction of the activity.

4.Check memory leaks through profiler and find memory leaks

Image

5.In actual use, the same problem will occur if the system kills the activity due to insufficient memory.

6.The same problem occurred with 3.27.1 and 3.32.8

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.found in release: 3.33Found to occur in 3.33found in release: 3.35Found to occur in 3.35frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onperf: memoryPerformance issues related to memoryplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions