How do I decrease memory usage when building a Flutter app for Release?

607 Views Asked by At

How do I decrease memory usage when building a Flutter app for Release?

I´m using these commands:

flutter build appbundle
flutter build ios --release --no-codesign

Afterwards it also gets treated by fastlane where I´m using

    upload_to_play_store(
      aab: "../build/app/outputs/bundle/Release/release.aab",
      skip_upload_metadata: "true",
      skip_upload_images: "true",
      skip_upload_screenshots: "true",
      track: "internal",
      json_key: "./fastlane/play-store-credentials.json",
    )

and

    build_app(workspace: "Runner.xcworkspace", scheme: "Runner", export_method: "app-store", include_symbols: "true")
    upload_to_testflight(skip_submission:'true', api_key_path: "fastlane/app-store-credentials.json", skip_waiting_for_build_processing:'true')

This all happens (sadly) on a CICD machine with only 8GB of RAM and the machine keeps randomly crashing or running out of memory with a system dialog popping up.

How can I tame the build process to only use e.g. 6GB of RAM or 2 CPU cores?

0

There are 0 best solutions below