We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We found that Lightning occasionally tries to double-release textures.
The problem is that when freeing a texture, this updates the Stage total used memory: https://github.com/rdkcentral/Lightning/blob/dev/src/tree/TextureManager.mjs#L164
Unfortunately ANY total memory usage update can cause an immediate GC: https://github.com/rdkcentral/Lightning/blob/dev/src/tree/Stage.mjs#L452
This can cause a race condition where a texture release can cause a GC run re-releasing the texture before it has finished the initial release.
Prevent Stage to run GC when updating the total memory with a negative delta:
const _addMemoryUsage = stage.addMemoryUsage; stage.addMemoryUsage = (delta) => { if (delta < 0) { stage._usedMemory += delta; } else { _addMemoryUsage.apply(stage, [delta]); } };
Possibly related issues: #492, #520, #521
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Issue
We found that Lightning occasionally tries to double-release textures.
The problem is that when freeing a texture, this updates the Stage total used memory:
https://github.com/rdkcentral/Lightning/blob/dev/src/tree/TextureManager.mjs#L164
Unfortunately ANY total memory usage update can cause an immediate GC:
https://github.com/rdkcentral/Lightning/blob/dev/src/tree/Stage.mjs#L452
This can cause a race condition where a texture release can cause a GC run re-releasing the texture before it has finished the initial release.
Workaround
Prevent Stage to run GC when updating the total memory with a negative delta:
Possibly related issues: #492, #520, #521
The text was updated successfully, but these errors were encountered: