Repository navigation
[MemoryManagement] Optimize texture management and release strategy for web overlay to prevent GPU memory issues - #1384
Merged
Conversation
…or web overlay to prevent GPU memory issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to GPU memory management for GUI and web overlay textures, aiming to make texture eviction more predictable and to avoid sudden stalls or out-of-memory errors, especially when sharing GPU resources with a web browser (HbbTV). The changes implement a soft texture budget, allow for gradual eviction of textures, and add new controls for when and how web overlay textures are released.
Texture budget and eviction improvements:
ENIGMA_TEX_BUDGET_MB), which can be set via environment variable or is learned automatically after the first out-of-memory event; this budget governs how many textures are kept in memory, and textures are now released gradually over multiple frames instead of all at once. [1] [2] [3] [4] [5]evictLRUandtrimTomethods ingTextureManagerto accept amax_countparameter, limiting how many textures are deleted per frame to avoid UI stalls. [1] [2] [3] [4]Web overlay texture lifecycle management:
setOnShow) that is triggered before the web overlay becomes visible, ensuring that cached GUI textures are released to free up GPU memory for the browser. [1] [2]ENIGMA_WEB_OVERLAY_IDLE_MS) after the overlay is hidden, releasing them when idle to reclaim GPU memory efficiently. [1] [2] [3] [4]Web overlay upload modes and robustness:
ENIGMA_WEB_OVERLAY_UPLOAD=destroy) that deletes the previous frame's texture and waits for the GPU to finish before allocating a new one, ensuring minimal GPU memory use by the overlay. [1] [2] [3]These updates collectively make texture management more robust and responsive, particularly in environments where GPU memory is shared between the GUI and web browser layers.