Camera's FireOnPreRender and FireOnPreCull events generate tons of GC Alloc

Hi,
I’m trying to optimize the GC allocations in my project and I’ve hit a brick wall.

This is profiled from standalone windows build:

There is not a single “OnPreRender” or “OnPreCull” callback in my entire project’s solution. The dev scene for testing is relatively simple. I have no idea how to go about optimizing this.

How do I approach the problem? What is causing these allocations and how do I address this?

Woops, incorrect.

GC comes from one of the assets I am using. Working with the developer on resolving this.

My bad!

To any moderators: You may remove this thread as there would probably be no constructive discussion from this.

1 Like

What asset was it? I too, am having large GC spikes from “Camera.FireOnPreCull()” and it’s around 2.4KB.

It was WeatherMaker in my case. I’ve since contacted the developer and problem has been fixed (they did some optimization work and there’s significantly less GC).

Ok thank you :slight_smile: I don’t use WeatherMaker, so I found out (after a lot of testing) that it was my “DynamicDecals” asset that was causing the GC spikes in my case. That asset is now deprecated, but I was able to find the problem functions thankfully.

Thanks for your reply.

I know this was 2 years ago, but do you know which functions they are and how to fix it? Thanks!

It was an old issue with Weather Maker plugin (highly recommended BTW), which has since been fixed. See post #4.