Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

fix oom bug #350

Merged
merged 4 commits into from
Aug 18, 2022
Merged

fix oom bug #350

merged 4 commits into from
Aug 18, 2022

Conversation

zhuxingwei
Copy link
Contributor

In this PR we aims to fix a potential OOM bug observed on android/ios devices.

The bug is caused by the fact that: in one frame, a CompositorContext is used to preroll and the paint the layer tree which holds a rasterize cache to boost the performance. Generally, it will first generate the cache in the preroll call and then at the end of the frame, it will release unused cache when the unique pointer of compositor_frame is released and the method CompositorContext::ScopedFrame::~ScopedFrame() is called. Note that since the cache holds shared memory between gpu and cpu, it is important to keep a valid gpu context while doing the release job.

However, in one PR I made before, it mistakenly clears the gpu context before the compositor_frame is released (which happens when the whole function is finished and the specific unique pointer is out of scope). As the result, the gpu side memory might be unable to be released properly.

To fix this issue, we just guarantee that we clear the gpu context only after the compositor_frame is released

@zhuxingwei zhuxingwei merged commit c0bbaf2 into master Aug 18, 2022
@zhuxingwei zhuxingwei deleted the zxw/fix_refresher_bug branch August 18, 2022 04:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant