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 in ios increase so fast that cause crash #36753

Closed
zf19820621 opened this issue Jul 23, 2019 · 8 comments
Closed

memory in ios increase so fast that cause crash #36753

zf19820621 opened this issue Jul 23, 2019 · 8 comments
Labels
a: images Loading, displaying, rendering images c: crash Stack traces logged to the console c: performance Relates to speed or footprint issues (see "perf:" labels) framework flutter/packages/flutter repository. See also f: labels. platform-ios iOS applications specifically waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@zf19820621
Copy link

zf19820621 commented Jul 23, 2019

I use flutter in my app which main function is for playing video. It has many movie pictures as cover of play. In android it does no problem, the memory is between 200MB and 300MB, but in ios, the memory start with 200MB more, and increase by every second, util it catch up to 500MB or 600MB, it crashed, with console tips:

Flushing 0 dxsdkdict out of the cache
Message from debugger: Terminated due to memory issue

Something else, i use cache_network_manager plugin for app images that use url at first, now i changed to flutter_advanced_networkimage plugin, but even though i disable memory cache for image or use empty widget replacing of image, the memory is still consumed very quickly, and crashed finally.I find some issues about ios memory, #32156
I think it is related with flutter engine and dart vm, but i'm not sure, and don't know how to resolve it, could you give me some advices, or helps, thanks.

my iphone crash dump:

{"app_name":"Runner","timestamp":"2019-07-22 16:24:35.42 +0800","app_version":"1.0.2","slice_uuid":"0fbabc02-22ec-3385-8b6f-61d6814f8cef","adam_id":0,"build_version":"2","bundleID":"com.cloud.ydqi","share_with_app_devs":true,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 12.3.1 (16F203)","incident_id":"7891C5D1-10AB-4D76-BBCF-DC18E43D57D2","name":"Runner"}
Incident Identifier: 7891C5D1-10AB-4D76-BBCF-DC18E43D57D2
CrashReporter Key:   76f0d9df223594c17fdf8b847ab24a83df839cef
Hardware Model:      iPhone7,1
Process:             Runner [815]
Path:                /private/var/containers/Bundle/Application/A18813D7-21DA-4FD4-8484-CAEA6B7767B8/Runner.app/Runner
Identifier:          com.cloud.ydqi
Version:             2 (1.0.2)
Code Type:           ARM-64 (Native)
Role:                Non UI
Parent Process:      launchd [1]
Coalition:           com.cloud.ydqi [617]


Date/Time:           2019-07-22 16:24:35.1475 +0800
Launch Time:         2019-07-22 16:24:33.0751 +0800
OS Version:          iPhone OS 12.3.1 (16F203)
Baseband Version:    7.70.01
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001acbd60dc 0x1acbb3000 + 143580
1   libsystem_pthread.dylib       	0x00000001acc4f094 0x1acc4d000 + 8340
2   libsystem_c.dylib             	0x00000001acb2fea8 0x1acad5000 + 372392
3   Flutter                       	0x0000000101397a10 0x101364000 + 211472
4   Flutter                       	0x00000001013cbc98 0x101364000 + 425112
5   Flutter                       	0x00000001013e49fc 0x101364000 + 526844
6   Flutter                       	0x0000000101372a68 0x101364000 + 60008
7   Flutter                       	0x000000010137f49c 0x101364000 + 111772
8   UIKitCore                     	0x00000001d94b3d40 0x1d8f3f000 + 5721408
9   UIFoundation                  	0x00000001b76bdf28 0x1b7651000 + 446248
10  UIFoundation                  	0x00000001b765d304 0x1b7651000 + 49924
11  UIKitCore                     	0x00000001d94b82ac 0x1d8f3f000 + 5739180
12  UIFoundation                  	0x00000001b76bdf28 0x1b7651000 + 446248
13  UIFoundation                  	0x00000001b76be16c 0x1b7651000 + 446828
14  UIFoundation                  	0x00000001b765d304 0x1b7651000 + 49924
15  UIKitCore                     	0x00000001d94b5b94 0x1d8f3f000 + 5729172
16  UIKitCore                     	0x00000001d99879a4 0x1d8f3f000 + 10783140
17  UIKitCore                     	0x00000001d97fb150 0x1d8f3f000 + 9158992
18  UIKitCore                     	0x00000001d97fb5d0 0x1d8f3f000 + 9160144
19  UIKitCore                     	0x00000001d97f9c34 0x1d8f3f000 + 9153588
20  UIKitCore                     	0x00000001d90bd2dc 0x1d8f3f000 + 1565404
21  UIKitCore                     	0x00000001d90c5874 0x1d8f3f000 + 1599604
22  UIKitCore                     	0x00000001d90bcf60 0x1d8f3f000 + 1564512
23  UIKitCore                     	0x00000001d90bd850 0x1d8f3f000 + 1566800
24  UIKitCore                     	0x00000001d90bbb9c 0x1d8f3f000 + 1559452
25  UIKitCore                     	0x00000001d90bb864 0x1d8f3f000 + 1558628
26  UIKitCore                     	0x00000001d90c03a4 0x1d8f3f000 + 1577892
27  UIKitCore                     	0x00000001d90c1188 0x1d8f3f000 + 1581448
28  UIKitCore                     	0x00000001d90c025c 0x1d8f3f000 + 1577564
29  UIKitCore                     	0x00000001d90c4f5c 0x1d8f3f000 + 1597276
30  UIKitCore                     	0x00000001d97f8328 0x1d8f3f000 + 9147176
31  UIKitCore                     	0x00000001d93f4ba8 0x1d8f3f000 + 4938664
32  FrontBoardServices            	0x00000001af9b49fc 0x1af9a9000 + 47612
33  FrontBoardServices            	0x00000001af9be40c 0x1af9a9000 + 87052
34  FrontBoardServices            	0x00000001af9bdc14 0x1af9a9000 + 85012
35  libdispatch.dylib             	0x00000001aca797d4 0x1aca19000 + 395220
36  libdispatch.dylib             	0x00000001aca1e5d8 0x1aca19000 + 21976
37  FrontBoardServices            	0x00000001af9ef040 0x1af9a9000 + 286784
38  FrontBoardServices            	0x00000001af9eecdc 0x1af9a9000 + 285916
39  FrontBoardServices            	0x00000001af9ef294 0x1af9a9000 + 287380
40  CoreFoundation                	0x00000001acfcb018 0x1acf21000 + 696344
41  CoreFoundation                	0x00000001acfcaf98 0x1acf21000 + 696216
42  CoreFoundation                	0x00000001acfca880 0x1acf21000 + 694400
43  CoreFoundation                	0x00000001acfc57bc 0x1acf21000 + 673724
44  CoreFoundation                	0x00000001acfc50b0 0x1acf21000 + 671920
45  GraphicsServices              	0x00000001af1c579c 0x1af1bb000 + 42908
46  UIKitCore                     	0x00000001d97fb978 0x1d8f3f000 + 9161080
47  Runner                        	0x00000001009ce350 0x1009c8000 + 25424
48  libdyld.dylib                 	0x00000001aca8a8e0 0x1aca89000 + 6368

XCode-instrument capture

image

flutter doctor

[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.5 18F132, locale
    zh-Hans-CN)
    • Flutter version 1.7.8+hotfix.3 at /Users/zhihuaxin/Downloads/flutter
    • Framework revision b712a172f9 (2 weeks ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0

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

[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
    • Xcode at /Applications/Xcode-10.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • CocoaPods version 1.7.4

[✓] iOS tools - develop for iOS devices
    • ios-deploy 1.9.4

[!] Android Studio (version 1.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[!] Android Studio (version 2.3)
    • Android Studio at /Applications/Android Studio 2.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio 3.app/Contents
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1136-b06)

[!] VS Code (version 1.15.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 device (2 available)
    • “zhx”的 iPhone • 4b23705b85bab8542fadfa6b52b2a1e13122e82c • ios • iOS
      12.3.1
    • iPhone Xʀ     • CBEF298D-069B-4D78-9455-0FC45F3BBD72     • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
@jmagman jmagman added c: crash Stack traces logged to the console c: performance Relates to speed or footprint issues (see "perf:" labels) platform-ios iOS applications specifically labels Jul 23, 2019
@zf19820621
Copy link
Author

zf19820621 commented Jul 24, 2019

I also found this problem with android app, however it is not badly as ios. I have tabview in app, and each page include listview component in which have many pictures from url. When i switch tab, and scroll the image list view fast, the android app 's memory increased, something like ios, but it can decrease after few seconds, back to normal. I captured from android profiler,
image

I forgot to say in previous issue, my iphone running memory is only 1GB, my android phone running memory is 4GB. So i think the problem would also happend if i use less memory android phone. Anyway, the android app is more stable, in the picture i upload, the memory varies only in native and graphic, the graphic reach up to almost 400MB more, then it will release and decrease.

This time i test in android studio with windows OS, flutter doctor as follow,

[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 6.1.7601], locale zh-CN)
    • Flutter version 1.7.8+hotfix.3 at D:\flutter
    • Framework revision b712a172f9 (2 weeks ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at D:\workTools\Android-SDK
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = D:\workTools\Android-SDK
    • Java binary at: D:\androidStudio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    X Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.

[√] Android Studio (version 3.2)
    • Android Studio at D:\androidStudio
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[√] IntelliJ IDEA Ultimate Edition (version 2018.3)
    • IntelliJ at D:\Program Files\JetBrains\IntelliJ IDEA 2018.3
    • Flutter plugin version 32.0.2
    • Dart plugin version 183.4733

[√] Connected device (1 available)
    • OPPO R9s • 9a8edc1b • android-arm64 • Android 6.0.1 (API 23)

! Doctor found issues in 1 category.

@cixiu
Copy link

cixiu commented Jul 25, 2019

i have same problem, when i scroll the image list view fast, the android app 's memory increased. like follows gif.
memory_increase

flutter doctor -v

[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.17134.885], locale zh-CN)                            
• Flutter version 1.7.8+hotfix.3 at D:\flutter                                                                                    
• Framework revision b712a172f9 (2 weeks ago), 2019-07-09 13:14:38 -0700                                                          • Engine revision 54ad777fd2                                                                                                      
• Dart version 2.4.0
     
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)                                                      • Android SDK at C:\Users\45089\AppData\Local\Android\sdk                                                                         • Android NDK location not configured (optional; useful for native profiling support)                                             • Platform android-28, build-tools 28.0.3                                                                                         
• Java binary at: D:\android-studio\jre\bin\java                                                                                  
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)                                                     • All Android licenses accepted.  
                                                                                                                                                 
[√] Android Studio (version 3.4)                                                                                                      
• Android Studio at D:\android-studio                                                                                             
• Flutter plugin version 37.1.1                                                                                                   
• Dart plugin version 183.6270                                                                                                    
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)      
                                                                                                                                                         
[√] Connected device (1 available)                                                                                                    
• BKL AL20 • P7C0218206014250 • android-arm64 • Android 9 (API 28)                                                                                                                                                                                              • No issues found!

@deverlion
Copy link

We also encountered the exact same problem. We have a video playback function, in the v1.5.4-hotfix.2 branch, everything works fine. However, when we upgrade to v1.7.8+hotfix.4, v1.8.2, IOS playback video will crash quickly, Android is OK. Ask for help, we would like to upgrade to v1.7.8+hotfix.4 to fix some solved problems.

@dnfield dnfield added a: images Loading, displaying, rendering images framework flutter/packages/flutter repository. See also f: labels. labels Jan 13, 2020
@dnfield
Copy link
Contributor

dnfield commented Jan 13, 2020

I suspect this is a case of the problem being addressed in #48536 - can you check if patching that in locally fixes your problem?

@dnfield dnfield added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 13, 2020
@jmagman jmagman added this to Awaiting Triage in Mobile - iOS performance review Feb 25, 2020
@VladyslavBondarenko
Copy link

@zf19820621
Is it still an issue with using current dev or master channel?

@no-response
Copy link

no-response bot commented Mar 12, 2020

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

@no-response no-response bot closed this as completed Mar 12, 2020
Mobile - iOS performance review automation moved this from Awaiting triage to Engineer reviewed Mar 12, 2020
@VladyslavBondarenko VladyslavBondarenko removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 12, 2020
Mobile - iOS performance review automation moved this from Engineer reviewed to Awaiting triage Mar 12, 2020
@VladyslavBondarenko VladyslavBondarenko added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 12, 2020
@Piinks
Copy link
Contributor

Piinks commented Apr 9, 2020

This bug has not been updated in a while, and the last updates suggest it may have been fixed. Therefore we are going to close it for now. Please don't hesitate to comment on the issue if you have more information for us; we will reopen it right away!

@Piinks Piinks closed this as completed Apr 9, 2020
Mobile - iOS performance review automation moved this from Awaiting triage to Engineer reviewed Apr 9, 2020
@lock
Copy link

lock bot commented Apr 25, 2020

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.

@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: images Loading, displaying, rendering images c: crash Stack traces logged to the console c: performance Relates to speed or footprint issues (see "perf:" labels) framework flutter/packages/flutter repository. See also f: labels. platform-ios iOS applications specifically waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
Mobile - iOS performance review
  
Engineer reviewed
Development

No branches or pull requests

7 participants