During the XAML export, by default images are serialized to XAML using the Convert.ToBase64String(byte[]) method. When the image is big, this causes allocation of a lot of memory (e.g. for 30MB image, the allocated memory for the string is ~300 MB), and when the base memory consumption of the process is high, this can cause OutOfMemoryException.