Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High Memory Usage #6

Closed
muukii opened this issue Oct 30, 2018 · 3 comments
Closed

High Memory Usage #6

muukii opened this issue Oct 30, 2018 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@muukii
Copy link
Collaborator

muukii commented Oct 30, 2018

When we open PixelEditorViewController, memory usage is very high that can see with Instruments.
It seems that ImageTool.resize cause this.

2018-10-31 3 07 02

https://developer.apple.com/videos/play/wwdc2018/416/

@muukii muukii added the help wanted Extra attention is needed label Nov 4, 2018
@Banannzza
Copy link

Banannzza commented Nov 5, 2018

Do you try to use downsampled images for drawing? I looked at the code a bit and if I understood correctly, the full image is loaded into memory.

In UIImagePickerControllerDelegate we can use info[.imageURL] (unfortunately .imageURL available from iOS 11) and put it to apple downsample image function from WWDC 2018 (https://developer.apple.com/videos/play/wwdc2018/219 39 page in pdf)

@muukii
Copy link
Collaborator Author

muukii commented Nov 6, 2018

@Banannzza
Thank you.
I tried to do that. However, I think I would like to use a large image to zoom that.
And I know that will use so many memory. (but why is this so huge? around 300MB!)
But It may have a good way of drawing. Do you have any good way?

If there is no way, we have no choice.
We will use a downsampled image from UIImagePickerController or PHAsset.

And, I did not know that .imageURL.
Definitely, we can resize that with ImageIO.

@Banannzza
Copy link

Banannzza commented Nov 6, 2018

@muukii Yes, image decoding can cause memory problems. I don't know better way of drawing, but if it exists I will try to find it .

@muukii muukii closed this as completed Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants