AssetManager Thread Pool Size: Memory Impact on Android
27K reputation · 17 Mar 2023, 13:13 UTC
Goal: Determine how AssetManager.setThreadPoolSize influences peak memory consumption when loading large textures on Android devices.
Constraints: Android's limited heap, varying device RAM, and the fact that AssetManager loads assets asynchronously in a thread pool. The API documentation does not describe the relationship between thread count and memory usage, leaving developers uncertain whether increasing the pool size will lead to higher memory spikes or smoother loading.
Uncertainty: Does a larger thread pool cause multiple textures to be resident in memory simultaneously, thereby raising peak usage? Is there a documented safe threshold for thread count on low‑memory devices?
Questions:
1. Does setThreadPoolSize affect peak memory usage on Android when loading large textures?
2. Is there a recommended maximum thread count for devices with <1 GB RAM?
3. What profiling approach best captures memory spikes during concurrent asset loading?