Timeline Memory Leak when editing clip.

What happened?
Everytime I try to edit a Timeline, Unity starts to take a lot of memory until it crashes, showing:
“Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5)
Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak”

Gyazo Gif added for showing the bug: Screen capture - 164d59493364374dab88d6605550a022 - Gyazo

How to replicate?
Weirdly, I tried to open a new project and it does not happen, same with same project in different computer, but it keeps happening in the same computer even after reinstalling.

I do not know if I can trace back what script is taking all that memory and not liberating it, or what can I do to fix this problem.

Specs and Workstation:
CPU: Ryzen 3300X
GPU: GTX 1660 SUPER
Unity: 2021.2.13f1 with URP 12.1.4
Cinemachine 2.8.4
Packages:

7939060–1015138–Editor.txt (1.3 MB)

Timeline itself doesn’t create jobs, but changes that Timeline triggers may do so. It would be hard to figure out what job caused this, as it could be anything in Unity.

If the issue only happens on a specific combination of machine and project, one thing you can try is delete your /Library/Timeline folder, and it all else fails, the entire Library folder (though I would advise doing this at the end of the day and starting a reimport to avoid wasting time).

I don’t see anything specific in the Editor log besides asset import worker threads getting spun before the leak, but that could be a red herring.

Many thanks for your reply, firstly.
I ran some testing and the culprit of the leak is the pressence of a terrain, specifically details like grass. Disabling the details by setting the details distance to 0 removes the leak. Tried several times, in different computers, same result.

Ok, I have shared this thread with the team responsible with terrain, but you may be able to get better traction by posting on the WorldBuilding forum.

I keep testing and what I’ve found out is that the Memory Leak depends highly on how many objects the scene has, not only because of the terrain.
I captured the Memory usage and I haven’t been able to get anything clear as the leak is set to “untracked” memory. I cand send you the capture if you need it, but here’s a screenshot:

Could you please submit a bug report? Make sure you include a link to this forum post. If you are able to include a project that exhibits the behavior, that’s also really useful.

Thanks!