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 this 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 class TestAssetLoad : MonoBehaviour
{
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.
Any idea ? Is it a bug to be fixed for large textures ?
Sounds like the UAP per frame time slice is not enough to load that texture in less that 4 frames. Did you try increasing the time slice value? Also, are you setting the async upload buffer size to accommodate such large texture beforehand?
I encountered similar issue.
unity2019.3.10f1 HDRP Addressable1.8.3
I loaded an assetbundle that contains huge scene with lots of textures.
In most case, a build freezed!!!
I seted async upload buffer size 4 (mb)
Async upload time slice 33(ms)
These settings solved this problem.
But I think that this is a bug.
Thanks @masak . I had the same problem on a very similar setup to yours which includes Addressables package, too. I could finally solve the problem after playing with those settings.
For those having a similar problem, you can read more on the following links.
Freeze bug means that app window does not react, and if i click it, windows says that this application is not responding…
If you click your app after 95% and windows says nothing, I think different case.