Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory keeps increasing leads to crashing in iOS(It would easily happen in iPhone 6) #19754

Closed
cxq1221 opened this issue Jul 25, 2018 · 20 comments
Assignees
Labels
a: quality A truly polished experience c: performance Relates to speed or footprint issues (see "perf:" labels) customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: gallery Relating to flutter/gallery repository. Please transfer non-framework issues there. engine flutter/engine repository. See also e: labels. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Comments

@cxq1221
Copy link

cxq1221 commented Jul 25, 2018

When pushing and popping a complicated page repeatedly, the memory keeps increasing.
The same issue also exists in Flutter Gallery.
As described above:
20180725173953

@zoechi
Copy link
Contributor

zoechi commented Jul 25, 2018

Please add the output of flutter doctor -v
What are the steps to reproduce using Flutter Gallery?

@cxq1221
Copy link
Author

cxq1221 commented Jul 25, 2018

[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.5 17F77, locale zh-Hans-CN)
    • Flutter version 0.5.1 at /Users/blockmake/Documents/Test/flutter
    • Framework revision c7ea3ca377 (8 weeks ago), 2018-05-29 21:07:33 +0200
    • Engine revision 1ed25ca7b7
    • Dart version 2.0.0-dev.58.0.flutter-f981f09760

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at //Users/blockmake/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = //Users/blockmake/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3, Build version 9E145
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.0

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 23.2.2
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[!] VS Code (version 1.25.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected devices (1 available)
    • iPhone • 954142ba4a5513dbcbc4bd0574633ca56c6e40b6 • ios • iOS 10.3.2

@cxq1221
Copy link
Author

cxq1221 commented Jul 25, 2018

Reproducing Steps: Push a page with complicated UI and pop, and do it repeatedly , or push diffrent pages repeatedly.

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine repository. See also e: labels. a: quality A truly polished experience customer: gallery Relating to flutter/gallery repository. Please transfer non-framework issues there. f: routes Navigator, Router, and related APIs. labels Jul 25, 2018
@ryansong
Copy link

I have the same problem, it seems FlutterViewController never be called dealloc to release. Every push will increase about 60+M memory.

@Natoto
Copy link

Natoto commented Dec 5, 2018

FlutterViewController can not be dealloc is a big big big big big bug , in v1.0 flutter

@zoechi zoechi added the c: performance Relates to speed or footprint issues (see "perf:" labels) label Dec 5, 2018
@zoechi zoechi added this to the Goals milestone Dec 5, 2018
@zoechi
Copy link
Contributor

zoechi commented Feb 22, 2019

@ryansong @Natoto sounds like #16995

@ened
Copy link
Contributor

ened commented May 8, 2019

Sounds more like a general performance issue on iPhone 6.

@joaquinperaza
Copy link

Same here, flutter is reducing our possibilities with this. 😟

@krishnakirana
Copy link

Call flutterEngine?.destroyContext() when you want release flutterViewController

@ened
Copy link
Contributor

ened commented Aug 13, 2019

@cxq1221 - can you please provide a simple sample project that shows the problem?

@maxermakov
Copy link

maxermakov commented Aug 21, 2019

@ened the example provided by topic-starter of this issue #32143 (don't know why it was closed) is always crashing on ios (testing on iPhone 6 and Iphone X)by the same reason as well as flutter gallery sample with flutter version v1.7.8+hotfix.2 stable channel and v1.9.0 from dev channel.

@charlesYun
Copy link

DestroyContext would crash

@DyaryRaoof
Copy link

@cxq1221 did you solve the issue. I have been having this issue for about a month now. no solution really frustrating.

@charlesYun
Copy link

This is a big problem that our team has also encountered. We hope the authorities can solve it as soon as possible

@DyaryRaoof
Copy link

Hopefully they will. I have also opened another issue regarding this topic, no answer though.

@iapicca iapicca added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label Nov 6, 2019
@liyuqian
Copy link
Contributor

CC @gaaclarke who has commented on #44256 . Aaron: can you please try to see if this issue can be reproduced?

@gaaclarke
Copy link
Member

There are a few issues that have addressed this. It sounds like some of the original comments are talking about a retain cycle with FlutterViewController, which isn't the case today.

Some of the comments talk about releasing resources when FlutterViewController is deleted, that was addressed in: flutter/engine#13396 . It seems like some people may want to look into FlutterViewController.allowHeadlessExecution.

One comment talks about the code in #32143 getting memory booted. I just ran that on master and it doesn't get memory booted. You can see when the image cache reaches a certain size it ejects things from memory.

I suggest we put out a call for a reproduction case that results in a memory boot on master. That will help us definitively say if there is an issue still and what exactly it is since a few different things have been talked about.

@gaaclarke gaaclarke added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 26, 2019
@talisk
Copy link
Contributor

talisk commented Dec 4, 2019

There are a few issues that have addressed this. It sounds like some of the original comments are talking about a retain cycle with FlutterViewController, which isn't the case today.

Some of the comments talk about releasing resources when FlutterViewController is deleted, that was addressed in: flutter/engine#13396 . It seems like some people may want to look into FlutterViewController.allowHeadlessExecution.

One comment talks about the code in #32143 getting memory booted. I just ran that on master and it doesn't get memory booted. You can see when the image cache reaches a certain size it ejects things from memory.

I suggest we put out a call for a reproduction case that results in a memory boot on master. That will help us definitively say if there is an issue still and what exactly it is since a few different things have been talked about.

Hi @gaaclarke . Compared to the solution that set allowHeadlessExecution to NO. I prefer to set allowHeadlessExecution to YES. And call destroyContext by a timer when the FlutterViewController dealloc. This should allow some code at the end can be executed.

Just like I described at #42643 and #44256

@Hixie
Copy link
Contributor

Hixie commented Jan 9, 2020

Based on @gaaclarke's comments last year, it sounds like this bug is not really actionable any more, because it covers many topics. I recommend that for each individual thing you would like to see changed, you file a separate bug and describe the use case, the bug, how to reproduce the bug, and so forth. Thanks.

@Hixie Hixie closed this as completed Jan 9, 2020
@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 14, 2021
@github-actions
Copy link

github-actions bot commented Aug 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: quality A truly polished experience c: performance Relates to speed or footprint issues (see "perf:" labels) customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: gallery Relating to flutter/gallery repository. Please transfer non-framework issues there. engine flutter/engine repository. See also e: labels. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests