Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

make drain perform cleanup #9004

Closed
wants to merge 3 commits into from
Closed

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented May 18, 2019

If the IO thread gets really busy decoding images, and then suddenly is not so busy for a while (e.g. it decodes a lot of large images that end up getting disposed of, and then there's nothing else for it to do), it can leave GrGLTextures laying around in memory for a while. According to @brianosman this call should fix that, and I'm seeing that it does. Not 100% sure this usage of WeakPtr is safe in Drain - it seems like it might be but hoping one of you will know better.

Should help somewhat with flutter/flutter#32143 but not a full fix. That will probably require some kind of queuing of decoding to try to make us more efficient. We can still run the risk of running out of GPU memory though :(

@cbracken
Copy link
Member

@chinmaygarde @dnfield I believe there have been offline discussions; what is the status of this PR?

@dnfield
Copy link
Contributor Author

dnfield commented Jun 17, 2019

It looks like the tests are failing on this. I'm going to try rerunning one to make sure it wasn't a flake, but if it's still failing I will close as it.

This is a strange edge case that I'm not sure is worth devoting much more time to at the moment. Chinmay has some other changes in the pipeline that should better relieve the core issue I was looking at here.

@dnfield
Copy link
Contributor Author

dnfield commented Jun 17, 2019

Something isn't right here - I'll re-open at some point if I can figure that out, but as I said I think this is more of an edge case - it should only happen if your app renders a lot of images and then has no new frames.

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

Successfully merging this pull request may close these issues.

3 participants