Question
AssetManager: Dependent assets remain loaded after primary asset is unloaded
Ash River
0 reputation · 28 Jun 2021, 22:59 UTC
14.9K views0
Problem Statement
When an asset that references other assets is unloaded via AssetManager.unload(), the dependent assets continue to occupy GPU and RAM memory, even though their reference counts drop to zero.
Constraints
AssetManager uses a global reference counter but does not traverse the dependency graph on unload. The API is identical across desktop, Android, iOS, and WebGL, and no configuration flag exists to alter this behavior.
Unresolved Questions
- Is there an undocumented option or future feature that will automatically release assets that are only referenced by a dependency of a removed asset?
- Would the library maintain backward compatibility if such an auto‑unload mechanism were introduced?
- Are there any platform‑specific workarounds or recommended patterns that developers can adopt to mitigate memory leaks?