Internal: JobTempAlloc error (with AudioRandomContainer and Rigidbody)

I’m starting to get this error seemingly out of the blue:

Internal: JobTempAlloc has allocations that are more than the maximum lifespan of 4 frames old - this is not allowed and likely a leak

diagnostics says this:

Allocation of 128 bytes at d004de10 in block 0 (frameIndex=14, lifetime=4, age=5, state=EXPIRED)
0x00007ff895e1ca34 (Unity) core::vector<CbKey const ,core::allocator<CbKey const ,0> >::grow
0x00007ff897192c8c (Unity) core::vector<SoundChannel,core::allocator<SoundChannel,0> >::push_back
0x00007ff8971848a3 (Unity) AudioSource::CacheSoundChannel
0x00007ff8971acdc9 (Unity) AudioClipPlayable::ApplyProperties
0x00007ff8971acf6b (Unity) AudioPlayable::ApplyPropertiesVisitor
0x00007ff8971b07fa (Unity) AudioPlayableTraverser::Traverse
0x00007ff8971af792 (Unity) OnApplyFMOD
0x00007ff896ace8cc (Unity) DirectorManager::ExecuteStage
0x00007ff896acedf0 (Unity) `DirectorManager::InitializeClass'::`2'::PostLateUpdateDirectorLateUpdateRegistrator::Forward
0x00007ff8967ab217 (Unity) ExecutePlayerLoop
0x00007ff8967ab387 (Unity) ExecutePlayerLoop
0x00007ff8967b047f (Unity) PlayerLoop
0x00007ff8978a788a (Unity) EditorPlayerLoop::Execute
0x00007ff8978be72a (Unity) PlayerLoopController::InternalUpdateScene
0x00007ff8978c050d (Unity) PlayerLoopController::UpdateSceneIfNeededFromMainLoop
0x00007ff8978ba1cc (Unity) Application::TickTimer
0x00007ff897e9539a (Unity) MainMessageLoop
0x00007ff897e9affc (Unity) UnityMain
0x00007ff65e572fba (Unity) __scrt_common_main_seh

the error happens when i pause everything with Time.timeScale = 0f;

it seems like only player’s audio is causing the error; also it’s very inconsistent, sometimes there are a few errors, sometimes there’s none. I haven’t touched player audio script in a few months, so no idea why it’s started doing this.
my version is 6000.0.58f1

So after a bunch of testing it looks like it happens if an audio source has RigidBody (not 2d) on it (or in my case inherit it). AND the audio source has to play Audio Random Container.

I don’t know what’s up with Rb and ARC, but there’s definitely something. Is this a bug?

Also any ideas how to fix it?

Thanks for flagging this, we had a previous bug with rigid bodies that we fixed in 6000.0.49f1, so it could be a knock on effect from that

If you have the time could you submit a bug report for us, with your reproduction steps you have? https://support.unity.com/hc/en-us/articles/206336985-How-do-I-submit-a-bug-report

Hm i tried to, but Packing the report is stuck at 0%

EDIT it got to 1%, i think it’s packing the entire project, I’ll try to send with the hub.

EDIT2 sent through the hub (CASE IN-136216)

yay, it’s on the tracker :star_struck:

Literally yesterday i got this error on uniy 6.5.0a7
But it has nothing to do with rigidbody. Only if you use AudioRandomContainer it leaks as f.
Also Editor start dying if you select AudioSource component and it for some reason generate GC for inspector

Im on 6000.0.58f1 and it’s definitely RB for me. Whenever ARC is playing and I set timescale to 0, if the object has no RB, there are no leaks. Maybe your case is a bit different.

Oh, my bad forgot to add “in my case”
I just wanted to say ARC got worse in future versions so they need look into it

Please, definitely make a bug report if you haven’t already. The issues might still be related and either way we don’t want this affecting us in the near future.

I seem to be having something similar happening:

The situation is:
AudioSorce is in a child object of Player wich has a rigidbody.
From code is calling AudioSource.Play.
AudioSource has a AudioRandomContainer set.

From my limited testing:

  • No matter what the audioclip, the problem persists. ( tested with .mp3 )
  • 2d / 3d blend or any other config in audioSource does not change the problem.
  • Same goes for the AudioRandomContainer configs/params.
  • The problem is inconsistent, sometimes gives me 1 warning per second, others 1 warning per minute.
  • Fullscreening the “Game” window makes it more consistent, sometimes 5+ warnings per second.
  • Having the AudioSource with no parent ( outside the player parent ) gives no warnings

After even more testing i found something more specific:

  • Placing the AudioSource as another obj ( with rigidbody ) trigger the same warning.
  • The configuration in the RigidBody component does not seem to affect the problem either.
  • Having the AudioSource outside during the scene, hitting play and moving it inside fixes the problem, but ONLY IF IT HAS STARTED PLAYING OUTSIDE, meaning was outside the player, played once, them moved inside the player WILL FIX IT
  • Doing the other way around, having it in the player, them move outside in play, have the same effect, only counting when the first “play” happened

So the warning will only be given if the AudioSource had it’s first “play” inside or not of a object with rigidbody.

Unity version: 6.5 ( 6.000.5.6f1 ) DX12

In my case this won’t be much of a problem, since the game will have a static camera in a somewhat 2D aspect, no sounds will need 3D blending, so i will just have the AudioSource outside any rigidbody, but this needs fixing.