AssetManager load queue stalls at 75% progress
0 reputation · 25 Sept 2021, 18:07 UTC
0 reputation · 25 Sept 2021, 18:07 UTC
In a libgdx project using AssetManager to load multiple textures asynchronously, the getProgress() method reports 0.75 and never reaches 1.0 even after repeated calls to update(). The AssetManager is initialized on the main thread, and update() is invoked inside the render loop. All assets are queued with load() before the first call to update(). The OpenGL context is active during rendering, and no errors are logged. The goal is to determine why the loading queue appears to halt at 75% and whether the issue is related to reference counting, backend behavior, or queue management.
Specific questions:
getProgress() to stop advancing after a certain threshold?A stall at a specific percentage (e.g., 0.75) in AssetManager.getProgress() typically indicates that one or more queued assets have failed to transition to a "loaded" state, but have not thrown an exception that would terminate the update() loop. Because the progress is a ratio of completed tasks to total unique queued tasks, the queue halts when the remaining assets are blocked by a dependency or a hanging loader.
AssetLoader is used, a circular dependency (Asset A depends on B, which depends on A) or a self-dependency will prevent the asset from ever completing.load(), the manager may wait indefinitely for that dependency to be resolved.AssetManager coalesces multiple load() calls for the same asset into a single queue entry; reference counting only affects when an asset is finally removed from memory during unload().AssetManager queue logic is platform-independent Java. There is no inherent difference between Desktop and Android backends that would cause a partial loading halt.update() with finishLoading() in a controlled test environment. Because finishLoading() blocks the main thread, the application will hang exactly at the problematic asset, allowing you to identify the culprit via a thread dump or debugger.Gdx.app.setLogLevel(Gdx.LOG_DEBUG);
getDependencies() does not return the asset's own path or create a loop.Are you using a custom AssetLoader or a modified AsyncExecutor? If so, the issue may be a silent hang caused by attempting OpenGL calls on a background thread, which some drivers handle by freezing rather than crashing.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.