Repository navigation
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
Steps to reproduce
Run code in profile mode, iOS, open memory tool, press button
Expected results
Do not use too much memory to compile svg
Actual results
Use a lot of memory (1.3 GB) and the process is very slow
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class TestApp extends StatefulWidget {
const TestApp({super.key});
@override
State<TestApp> createState() => _TestAppState();
}
class _TestAppState extends State<TestApp> {
bool show = false;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: () {
setState(() {
show = !show;
});
},
),
body: !show ? SizedBox() : SingleChildScrollView(
child: Column(
children: List.generate(40, (e) {
return SvgPicture.network('https://icons.getbootstrap.com/assets/icons/building-fill-exclamation.svg?v=$e');
}),
),
),
),
);
}
}
flutter_svg: 2.2.4
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.41.5, on macOS 26.3.1 25D2128 darwin-arm64, locale en-VN)
[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 26.2)
[✓] Chrome - develop for the web
[✓] Connected device (4 available)
! Error: Browsing on the local area network for iPhone. 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. 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.Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Activity
saurabh-mirajkar commentedon Apr 6, 2026
@xuantungdev0401 Thanks for the detailed report.
I notice the SVG URL includes a changing query param (
?v=$e), which prevents caching and forces each SVG to be downloaded and compiled separately. This could significantly increase memory usage.To help us investigate further:
?v=$e)?Keeping this open for further investigation once we have the above details.
xuantungdev0401 commentedon Apr 6, 2026
Hi @saurabh-mirajkar
If only 1 url is used, the memory is not increased so much.
But we usually have many svg icons in 1 screen so the problem is still there.
Yes
I cannot capture snapshot but I have a image here
saurabh-mirajkar commentedon Apr 6, 2026
Thanks for the additional details. Labelling for
team-engineto investigate further.[flutter_svg] Add a byte budget for the compiled SVG cache (#13596)