RAM leak and very long Application.UpdateScene

Hi,

I guess i’m missing something , but i manage to work with 2 VCAMS (track and dolly) smoothly.

Usually , things become very slow when i add the third VCAM - When i try to scrub / play and cache the timeline, i get more and more frequent Application.UpdateScene alerts which can last for minutes, and the RAM usage in the Task Manager gradually goes up from 4GB to 55 GB , at that stage i end the task.

The scene i’m working with is a very big terrain but its very responsive until i start the cinemachine process.

I could not trace the exact moment the problem starts but it seems i’m messing things up…

Any help is highly appriciated.

thanks.


Thanks for this report. We have not internally seen any such behaviour. If you can send me a project that reproduces this problem, it would greatly help in tracking it down. In the meantime, you can try disabling the Scrubbing Cache (click on a CM clip in the timeline, there is a checkbox in the inspector to disable the cache).

What version of CM are you using?

I’m on version 2.6, i’ve unchecked USE SCRUB BUBBLE, thats the closest to CACHE i’ve found - is that it ?.

It still persists with the very long update and RAM usage - i’ll try to reduce project size to be able to send it.

thank you.

I hope it’s usable - i’ve attached a project file without all the big assets - only the cameras, and an object which i’m following.
thanks

6209163–682161–Assets.7z (790 KB)

The transition between VCAMs (scrubbing or just clicking on the timeline) is the moment things start to go out of control. As long as i stay in the same VCAM it’s ok, which is not ok…

I’m also having a similar issue. When I switch between cameras clicking on the timeline for example I can see Unity freezing for a few seconds and memory usage spiking (CPU use is low). The more I switch between cameras the more I see the memory usage grow and Unity becoming unresponsive for a longer time. After a while, I need to kill unity and reopen it again.

1 Like

Very comforting… couldn’t find anything similar on google so far.

And the repetition issue is the same, more switching - longer update times, more RAM.

1 Like

Yes exactly. My project in Unity is using around 3GB RAM, and until I stay on the same camera in the timeline it stays that way. If I switch too much it goes up, more and more until Unity becomes unresponsive.
I’m using 3 cameras in cinemachine, but it’s a quite standard project with nothing out of the ordinary. For testing I’ve also disabled the bubble scrub.

What kind of cameras are you using in your project? The only particular thing I have is a very long dolly track (it’s for a car chase, around 60 points) and I’m using the Recomposer extension (I think this is only in the latest version?) but that’s it.

I’m using one regular vcam and one dolly, the third vcam went down after a fight of about 20 end-task escalations…

At some point I thought that what messes things up is the fact that I’m adding more timeline animation constraints on the vcams. But that’s not the issue apparently…

1 Like

Hi Gregory,

any ideas?

thanks.

1 Like

Unfortunately I’m unable to see anything with this. The best way to test it yourself is to create a new project, add the assets you sent me, and see if you can repro the problem. If not, keep adding stuff until you can.

If you prefer, you can upload the whole project somewhere and PM me with a link to it. If you give me detailed repro steps, I can try to repro the problem.

Hi Gregoryl,

I have the same issue with timeline and cinemachine. I’m using
2020.1.3f1 (the same thing is happening with 2020.1.2f1) and Cinemachine 2.6.1
I’m attaching link with a movie where you can see everything properly described. Please help.

2 Likes

@connectorone Clearly there is something very wrong. We have tried to reproduce this so far without success. Can you send me your project?

3 Likes

Hey @mardulis @PXLArtificer @connectorone ,

@connectorone 's movie gave me the clue: PostProcessing! I can repro this now. The massive leak is somewhere in the PostProcessing package. CM calls PostProcessLayer.ResetHistory() on camera cuts, and that’s where the leak is happening. I will reach out to the PostProcessing team.

Thanks to all of you for reporting this.

3 Likes

@connectorone - I didn’t get the chance to repro this on a clean project and your movie was a thrill to watch. thanks

@Gregoryl thanks. please update us as things advance !

1 Like

Thank you @Gregoryl . Do you still need my project to check? If yes, please send me your email adress here:
przemyslaw@showstorm.co.uk

Hi again @mardulis @PXLArtificer @connectorone ,

It turns out that I was wrong in my previous diagnosis: it’s not PostProcessing, it’s Cinemachine after all, in the part that invokes PostProcessing’s ResetHistory. It’s a regression introduced in CM 2.6.0. We are rushing to put out a patch release, which will be 2.6.2.

Because that can take some time to work its way through our system, I’m attaching here a patched version of CinemachinePostProcessing.cs. You can use it to directly patch the version in your project, and the leak will go away.

Many thanks for your patience and help in spotting this problem.

@connectorone I don’t need your project any more, thanks.

6254013–689565–CinemachinePostProcessing.cs (13.8 KB)

1 Like

@Gregoryl thank you for your assistance. Unfortunately it doesn’t help at all. Still the same problem.

Waiting for more info.

How did you install the file I sent?

I’ve replaced the previous version in the APPDATA LOCAL folder - this method didn’t help.

How should I install the file ?