{"action":"created","issue":{"url":"https://api.github.com/repos/MetalPetal/MetalPetal/issues/49","repository_url":"https://api.github.com/repos/MetalPetal/MetalPetal","labels_url":"https://api.github.com/repos/MetalPetal/MetalPetal/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/MetalPetal/MetalPetal/issues/49/comments","events_url":"https://api.github.com/repos/MetalPetal/MetalPetal/issues/49/events","html_url":"https://github.com/MetalPetal/MetalPetal/issues/49","id":367692308,"node_id":"MDU6SXNzdWUzNjc2OTIzMDg=","number":49,"title":"Memory issue","user":{"login":"SerjPridestar","id":40886052,"node_id":"MDQ6VXNlcjQwODg2MDUy","avatar_url":"https://avatars3.githubusercontent.com/u/40886052?v=4","gravatar_id":"","url":"https://api.github.com/users/SerjPridestar","html_url":"https://github.com/SerjPridestar","followers_url":"https://api.github.com/users/SerjPridestar/followers","following_url":"https://api.github.com/users/SerjPridestar/following{/other_user}","gists_url":"https://api.github.com/users/SerjPridestar/gists{/gist_id}","starred_url":"https://api.github.com/users/SerjPridestar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SerjPridestar/subscriptions","organizations_url":"https://api.github.com/users/SerjPridestar/orgs","repos_url":"https://api.github.com/users/SerjPridestar/repos","events_url":"https://api.github.com/users/SerjPridestar/events{/privacy}","received_events_url":"https://api.github.com/users/SerjPridestar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-08T08:55:17Z","updated_at":"2018-10-09T04:38:51Z","closed_at":null,"author_association":"NONE","body":"Hello Yuao! Hope you are doing good!\r\n\r\nAs you might remember, I was experimenting using MetalPetal to generate a video asset from a set of images. I added a feature to it where on completion the class returns all the images it used to render the video for any post processing video needs. I used `let cgImages = try images.map({ try self.context.makeCGImage(from: $0) })` after that code is executed I notice a huge memory footprint remaining in memory. I'm not sure if I'm doing anything wrong, but I checked the leak profiler and there was no leak detected.\r\n\r\nUsually when I am generating a video out of images the render method increments a 15mb - 20mb per image. After the video generation is complete I am left with a 600mb memory in RAM, before I would be left with approximately 140mb, which is also bad, however, it was easier to get by with. Additionally, it's important for me to mention that I am rendering really high resolution images directly from the iOS camera, they are approximately 3k or 4k resolution. You might be wondering why not just transform the images to a smaller resolution and render them then? That's because it's a requirement for me to be able to render really high resolution images as I would want the video to be high resolution itself.\r\n\r\nI also tried checking the allocation profiler, but there is an unusual case where the allocation shows the memory spike to 30mb when the video generation begins and then it gradually goes down to 10mb; on the other hand, on the leak profiler actually shows the spike to 400mb 600mb. It is very weird.\r\n\r\nI have set up the project [here](https://github.com/SerjPridestar/MetalPetalVideoGenerator) if you are willing to do some investigations. I have set warnings where I think things are going wrong so that it would be easy to navigate to the problem directly. Thank you in advance for reading this long issue. "},"comment":{"url":"https://api.github.com/repos/MetalPetal/MetalPetal/issues/comments/428057131","html_url":"https://github.com/MetalPetal/MetalPetal/issues/49#issuecomment-428057131","issue_url":"https://api.github.com/repos/MetalPetal/MetalPetal/issues/49","id":428057131,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODA1NzEzMQ==","user":{"login":"YuAo","id":1234944,"node_id":"MDQ6VXNlcjEyMzQ5NDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1234944?v=4","gravatar_id":"","url":"https://api.github.com/users/YuAo","html_url":"https://github.com/YuAo","followers_url":"https://api.github.com/users/YuAo/followers","following_url":"https://api.github.com/users/YuAo/following{/other_user}","gists_url":"https://api.github.com/users/YuAo/gists{/gist_id}","starred_url":"https://api.github.com/users/YuAo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YuAo/subscriptions","organizations_url":"https://api.github.com/users/YuAo/orgs","repos_url":"https://api.github.com/users/YuAo/repos","events_url":"https://api.github.com/users/YuAo/events{/privacy}","received_events_url":"https://api.github.com/users/YuAo/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T04:38:51Z","updated_at":"2018-10-09T04:38:51Z","author_association":"MEMBER","body":"The situation here is a little bit weird, I may need some more time to investigate."}}
{"actor":{"display_login":"YuAo"}}