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

Memory optimisation #379

Open
2 tasks
ChanakyaHirpara opened this issue Feb 2, 2024 · 2 comments
Open
2 tasks

Memory optimisation #379

ChanakyaHirpara opened this issue Feb 2, 2024 · 2 comments

Comments

@ChanakyaHirpara
Copy link

Checklist

I am implementing effects like blur, contrast etc. I am using MTICoreImageUnaryFilter for that. Whenever I try to apply 5-7 such filter memory jumps and app is crashing. The reference image size I am using is 4480x6720 as I want to export original size image.

Is there any special function I have to use to reclaim memory?

@cgfarmer4
Copy link

cgfarmer4 commented Feb 4, 2024

@ChanakyaHirpara you can reclaimResources() from the MTIcontext and use an autoreleasepool where needed. However with an image that large, you are likely to see high memory usage regardless. You may want to downsample the image, blur, then resample. Blurring is fine to lose some fidelity.

@ChanakyaHirpara
Copy link
Author

I am using FilterGraph and before I can reclaimResources it crashes. It is working good with downsampled but I want to apply those filter chains on the original image for export reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants