Faced similar issue. This is well explained in this thread -
Why use a lot of memory when drawing image with UIGraphicsImageRenderer?