Skip to content

Flutter desktop Windows Release High CPU usage #78517

@xkeyC

Description

@xkeyC

Flutter app Windows release used too much cpu. (Single core occupies up to 100%)

image
image
image

Details

Target Platform: Windows
Target OS version/browser: Windows 10 20H2 (19042.867) Windows Feature Experience Pack 120.2212.551.0
Devices: Intel(R) Core(TM) i5-9300H

Steps to reproduce

  1. flutter create windows_test
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("Windows Test"),
        ),
      ),
    );
  }
}
  1. flutter build windows
  2. run windows_test\build\windows\runner\Release\windows_test.exe

Logs

Logs
PS C:\Users\me\project\windows_test> flutter analyze
Analyzing windows_test...
No issues found! (ran in 1.4s)
PS C:\Users\me\project\windows_test>

PS C:\Users\me\project\windows_test> flutter doctor -v
[√] Flutter (Channel master, 2.1.0-13.0.pre.159, on Microsoft Windows [Version 10.0.19042.867], locale zh-CN)
    • Flutter version 2.1.0-13.0.pre.159 at C:\Users\me\AppData\Local\Android\flutter
    • Framework revision e8c3ce6bd1 (2 hours ago), 2021-03-17 22:13:13 -0700
    • Engine revision b5091d6a7d
    • Dart version 2.13.0 (build 2.13.0-148.0.dev)
    • Pub download mirror http://127.0.0.1:59776/pub
    • Flutter download mirror http://127.0.0.1:59776/storage

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\me\AppData\Local\Android\Sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = C:\Users\me\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.5)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.8.31005.135
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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 1.8.0_242-release-1644-b01)

[√] IntelliJ IDEA Ultimate Edition (version 2020.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.2
    • 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

[√] VS Code (version 1.54.2)
    • VS Code at C:\Users\me\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19042.867]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 89.0.4389.90
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 89.0.774.54

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toola: desktopRunning on desktopc: performanceRelates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.found in release: 2.1Found to occur in 2.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onperf: memoryPerformance issues related to memoryplatform-windowsBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions