[AssetBundles][AUP][Textures] JobTempAlloc has allocations that are more than 4 frames old

Hi everyone,

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 ?

Up :slight_smile: the issue also occurs in 2019.3

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 set up the async values at their maximum but I’m still getting the issue… :frowning: Any more ideas ? :slight_smile:

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.

1 Like

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.

https://blogs.unity3d.com/2018/10/08/optimizing-loading-performance-understanding-the-async-upload-pipeline/

https://docs.unity3d.com/ScriptReference/QualitySettings.html

5860951--623077--ma9RtOd3s6.png

I found that if you limit the framerate cap to something low in the loading screens then this error goes away
Application.targetFrameRate = 30;

1 Like

Unity2019.4.0f1 solved the freeze bug. (( Editor shows lots of warning as usual

2019.4.3f1 showed the freeze bug in some environment…
This bug appeared in issue tracker.
plz vote

Hi @masak
Could you please explain what do you mean saying “freeze bug”?

We came accross some loading issue. For some devices the loading progress doesn’t go more than 95% and stays there forever.
Is your case the same?

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.

1 Like