AssetBundle "JobTempAlloc has allocations that are more than 4 frames old" with large textures
Using Unity 2019.2, I encounter a problem loading (at runtime) an AssetBundle containing a 3D model with a texture with crunch compression (50%).
Every time I load a 3D model at runtime from the asset bundle, I get this message :
JobTempAlloc has allocations that are more than 4 frames old.
To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations
Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 6)
How to reproduce :
Create an asset bundle with a 3D model (a simple cube is enough) having a very large texture (+10mb uncompressed, 8K texture, like the one I attached) and use crunch compression at 50%. For the bundle, juste use uncompressed or LZMA settings.
Load the model and place it in the scene with LoadAssetAsync with the following code
public string path = "/path/cube"; void Update() { if (Input.GetKeyDown(KeyCode.K)) StartCoroutine(LoadAsset()); } public IEnumerator LoadAsset() { AssetBundleCreateRequest bundleLoadRequest = AssetBundle.LoadFromFileAsync(path); yield return bundleLoadRequest; AssetBundle Bundle = bundleLoadRequest.assetBundle; if (Bundle == null) { Debug.Log("Failed to load AssetBundle!"); yield break; } AssetBundleRequest assetLoadRequest = Bundle.LoadAssetAsync<GameObject>("cube"); yield return assetLoadRequest; GameObject prefab = assetLoadRequest.asset as GameObject; Instantiate(prefab); }
You should see the message. I think this warning is due to the processing of the texture which is done with AUP (Async Upload Pipeline) on jobs that last more than 4 frames (due to the size of the texture), because it would not show up if crunch compression is not activated.
I already tried to change the async buffer and the time slice values in the quality settings, but it changes nothing. I reported a bug but my ticket was ignored and closed.
Any idea ? Is it a bug to be fixed for large textures ?
Your answer
Follow this Question
Related Questions
Crunch Texture compression throws exceptions 0 Answers
AssetBundle Textures not loading 0 Answers
How to make texture readable for assetbundle 1 Answer
Proc assetbundle.LoadAssetAsync thread in editor. 0 Answers
How Can I Create My Own Textures? 3 Answers