Widget Extension Jetsamming when Loading SVG Images

To reproduce:

  1. Create a new standard iOS project and add a Widget extension to it.
  2. Download an SVG from here: https://pixabay.com/vectors/flourish-decorative-ornamental-3166119/
  3. Add the SVG asset into Assets.xcassets.
  4. Replace the line Text(entry.date, style: .time) with Image("flourish-3166119").frame(width: 20).

When running the extension, I get Thread 1: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=30 MB, unused=0x0). Notice that the asset is only 8k but something in the rendering of the SVG into bitmap cause a memory spike.

I tested this with Xcode 13.0, iOS 14.4.1 Xs MAX device.

Is there a way to overcome this, or should I dump SVG and pre render the images for x2 and x3 scale factors and call it a day?

Edit: Just to clarify, the issue happens with only 1 entry as well. I attached the full source for reference.

convenience:

I found a workaround for this. I converted the SVG files to PDFs. It seems that the code which does the PDF rendering consumes less memory.

Widget Extension Jetsamming when Loading SVG Images
 
 
Q