flutter / flutter/flutter

iOS excessive GPU memory usage

Open
#165,185 8 comments 0 reactions 0 assignees View on GitHub
engine found in release: 3.29 found in release: 3.30 has reproducible steps P3 perf: memory platform-ios team-engine triaged-engine
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

Latest Flutter, creates several big textures and large buffers which were not created by a year old engine.
1. I used latest stable and 3.30.0-1.0.pre.603
2. Create default app: `flutter create new_engine`
3. Open `open ios/Runner.xcworkspace` and in schema editor change build configuration to Profile and in Options tab change GPU Frame Capture to Metal.
4. Run app
5. Click M button and tap on flutter app's + button to trigger screen repaint

You should get something like this:

![Image](https://github.com/user-attachments/assets/80dc06f6-d895-4e6e-9c92-8a3949440747)

There are 2 unused textures and 4 1Mb buffers. I can see that from time to time those texture disappear, if I rotate phone. In our real app, I think I saw 3 unused textures.
Is this normal?

### Expected results

Compare that to 3.13.9

![Image](https://github.com/user-attachments/assets/10abdf0d-2c43-4d49-b5f4-84eb7459a201)

### Actual results

71.40M GPU memory used.

### Code sample

Just create flutter's base app with `flutter create ...`

### Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

### Logs

Logs

```console
[Paste your logs here]
```

### Flutter Doctor output

Doctor output

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.30.0-1.0.pre.603, on macOS 15.3.2 24D81 darwin-arm64, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
✗ cmdline-tools component is missing.
Try installing or updating Android Studio.
Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable.
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.3.1.1)
[✓] VS Code (version 1.98.1)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for Kiwi. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for iPhone 11. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

! Doctor found issues in 1 category.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.