Fix XMB thumbnail memory exhaustion on low-memory devices#18854
Fix XMB thumbnail memory exhaustion on low-memory devices#18854ma-moon wants to merge 1 commit intolibretro:masterfrom
Conversation
…roll detection, frees textures. Fixes libretro#6747
|
This is the clean, rebased version of #18828.
Ready for merge. Please review when you have time. Thanks! Best, |
|
All CI checks are green. No merge conflicts. Please merge when you have time. Thanks! Best, |
1 similar comment
|
All CI checks are green. No merge conflicts. Please merge when you have time. Thanks! Best, |
|
CI passed, ready for review. Could you take a look when you have time? Thanks! |
There was a problem hiding this comment.
Would it make sense to apply this beyond XMB? The other themes load thumbnails too, maybe they'd apply?
| #if defined(HAVE_OPENGLES) || defined(__SWITCH__) || defined(ANDROID) | ||
| /* Low-memory platforms: limit to 2 concurrent loads */ | ||
| gfx_thumbnail_set_max_concurrent_loads(2); | ||
| #else | ||
| /* Desktop platforms: allow 4 concurrent loads */ | ||
| gfx_thumbnail_set_max_concurrent_loads(4); | ||
| #endif |
There was a problem hiding this comment.
Hardcoding 2 vs 4 indicates it could likely live better as a defined macro that could be changed during compilation flags.
#ifndef GFX_THUMBNAIL_MAX_CONCURRENT_LOADS
#define GFX_THUMBNAIL_MAX_CONCURRENT_LOADS 4
#endif| /* LOW-MEMORY FIX: Maximum number of concurrent thumbnail load tasks | ||
| * Helps prevent memory exhaustion on low-memory devices (RPi, Switch, etc.) */ |
There was a problem hiding this comment.
Writing LOW-MEMORY FIX everywhere is unnecessary.
| /* LOW-MEMORY FIX: Maximum number of concurrent thumbnail load tasks | |
| * Helps prevent memory exhaustion on low-memory devices (RPi, Switch, etc.) */ | |
| /* Limits the number of thumbnails that can be loaded concurrently. | |
| * Helps prevent memory exhaustion on low-memory devices (RPi, Switch, etc.) */ |
| /* LOW-MEMORY FIX: Concurrent load management API */ | ||
|
|
There was a problem hiding this comment.
Not needed. It's covered in the doxygen docs of the function definitions.
| /* LOW-MEMORY FIX: Concurrent load management API */ |
Description
This PR fixes severe memory exhaustion issues in the XMB menu when loading thumbnails on low-memory devices (e.g., embedded systems, older phones).
This is a cleaned-up version of the changes originally proposed in #18828, squashed into a single commit based on the latest master.
Changes
Related Issue
Fixes #6747
Testing
Tested on low-memory environments; verified stable memory usage during rapid scrolling and large library navigation.