flame_3d RSS Memory Leak when targeting Pixel 7 Pro

#3588
jlaw3251jlaw3251
opened 4 months ago
Author

What happened?

The flame_3d example (and anything I would make using flame_3d) runs for ~1 minute and then crashes due to an out of memory error. The memory tab in Flutter DevTools shows RSS memory increasing consistently over time, even if I don't interact with the app at all. Running in different modes (release vs. debug vs. profile) changes nothing.

What do you expect?

No out of memory error

How can we reproduce this?

Do flutter run on the flame_3d example (or anything that uses flame_3d) and targeting a (physical, not emulated) Google Pixel 7 pro.

What steps should take to fix this?

No response

Do have an example of where the bug occurs?

The flame_3d example (or any code using flame_3d)

Relevant log output

I/scudo ( 2112): Can't populate more pages for size class 65552. W/libc ( 2112): malloc(444000) failed: returning null pointer F/libc ( 2112): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 2112 (example.example), pid 2112 (example.example) *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'google/cheetah/cheetah:15/BP1A.250405.007.B1/13240308:user/release-keys' Revision: 'MP1.0' ABI: 'arm64' Timestamp: 2025-05-01 01:31:52.419707170-0400 Process uptime: 123s Cmdline: com.example.example pid: 2112, tid: 2112, name: example.example >>> com.example.example <<< uid: 10362 tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE) signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000 Cause: null pointer dereference x0 0000007fdf1053f8 x1 b40000713cba3c48 x2 b40000713cba3c48 x3 b40000713cba3a30 x4 b400006ffca98ba0 x5 0000006d00449e29 x6 b4000070eca76750 x7 b400006fbcacecc0 x8 0000007fdf105400 x9 0000000000000000 x10 0000000000000000 x11 0000000000000083 x12 0000006d00000004 x13 0000000000000002 x14 0000006d00000000 x15 0000007fdf1054a0 x16 0000000000000001 x17 b40000702cb15550 x18 000000724d20c000 x19 0000007fdf105460 x20 0000000000000000 x21 b40000702cb14d70 x22 0000006d00008081 x23 0000006d00449e19 x24 0000006d00008081 x25 0000007fde92a000 x26 b40000702cb14d70 x27 0000006d04de5750 x28 000000080000006d x29 0000007fdf1054b0 lr 0000006eefb02470 sp 0000007fdf105340 pc 0000006eefb02470 pst 0000000060001000 4 total frames backtrace: #00 pc 0000000001d92470 /data/app/~~eBKkIZwtqqKR5nG_Bsl9CQ==/com.example.example-RsyE8vbuCGgzQFsViqUSOg==/lib/arm64/libflutter.so (BuildId: 542b8dc2ac7a8e99326bedaf272ab95c0d95d89c) #01 pc 00000000021b7bc8 /data/app/~~eBKkIZwtqqKR5nG_Bsl9CQ==/com.example.example-RsyE8vbuCGgzQFsViqUSOg==/lib/arm64/libflutter.so (BuildId: 542b8dc2ac7a8e99326bedaf272ab95c0d95d89c) #02 pc 00000000021b860c /data/app/~~eBKkIZwtqqKR5nG_Bsl9CQ==/com.example.example-RsyE8vbuCGgzQFsViqUSOg==/lib/arm64/libflutter.so (InternalFlutterGpu_RenderPass_Begin+4) (BuildId: 542b8dc2ac7a8e99326bedaf272ab95c0d95d89c) #03 pc 0000000000008184 [anon:dart-code] Lost connection to device.

Execute in a terminal and put output into the code block below

[✓] Flutter (Channel stable, 3.29.3, on Ubuntu 22.04.5 LTS 5.15.167.4-microsoft-standard-WSL2, locale C.UTF-8) [109ms] • Flutter version 3.29.3 on channel stable at /home/user/snap/flutter/common/flutter • Upstream repository git@github.com:flutter/flutter.git • Framework revision ea121f8859 (3 weeks ago), 2025-04-11 19:10:07 +0000 • Engine revision cf56914b32 • Dart version 3.7.2 • DevTools version 2.42.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [2.4s] • Android SDK at /home/user/Android/Sdk • Platform android-35, build-tools 35.0.1 • ANDROID_HOME = /home/user/Android/Sdk • Java binary at: /snap/android-studio/192/jbr/bin/java This is the JDK bundled with the latest Android Studio installation on this machine. To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk". • Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42) • All Android licenses accepted.

[✓] Chrome - develop for the web [21ms] • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop [909ms] • clang version 10.0.0-4ubuntu1 • cmake version 3.16.3 • ninja version 1.10.0 • pkg-config version 0.29.1

[✓] Android Studio (version 2024.3) [18ms] • Android Studio at /snap/android-studio/192 • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)

[✓] Connected device (3 available) [188ms] • Pixel 7 Pro (mobile) • ip:port • android-arm64 • Android 15 (API 35) • Linux (desktop) • linux • linux-x64 • Ubuntu 22.04.5 LTS 5.15.167.4-microsoft-standard-WSL2 • Chrome (web) • chrome • web-javascript • Google Chrome 132.0.6834.159

[✓] Network resources [356ms] • All expected network resources are available.

• No issues found!

Affected platforms

Android

Other information

I don't have any other physical Android devices to test with. I'm not sure if it's just my phone that's the problem; although, if it is, I would be grateful for advice to fix it.

Are you interested in working on a PR for this?

  • I want to work on this