Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

LWRP constantly creating several KB of garbage per frame

Discussion in 'Universal Render Pipeline' started by SVC-Games, Jun 6, 2019.

  1. SVC-Games

    SVC-Games

    Joined:
    May 21, 2013
    Posts:
    115
    So I was profiling a test project and noticed GC Allocs on "RenderPipelineManager.DoRenderLoop_Internal()"

    Just to be sure I created a new LWRP project (Unity 2019.1.5) and just run the Sample Scene. And yes, I'm having 3.6 KB of garbage generated every frame.

    Furthermore "ScriptableRuntimeReflectionSystemWrapper.Internal_ScriptableRuntimeReflectionSystemWrapper_TickRealtimeProbes()" is generating 40 B per frame.

    And sure enough, spikes ocur every now and then... Again, this is a brand new project, running the Sample Scene.

    I assume this is a bug of LWRP? For something that is "production ready" this seems like an issue...
     
  2. SVC-Games

    SVC-Games

    Joined:
    May 21, 2013
    Posts:
    115
    Here's a screenshot of the profiler:

    GC Alloc LWRP.JPG

    As you can see it's definetly a LWRP problem. It doesn't seem to be much, but just in a few seconds you end up with MB of garbage which will prompt the GC collector and stuttering
     
  3. minearjade

    minearjade

    Joined:
    Sep 29, 2017
    Posts:
    2
    Can confirm, this is a headache.
     
    SVC-Games likes this.
  4. rob_unity7

    rob_unity7

    Joined:
    Feb 8, 2019
    Posts:
    37
    I'm finding this too. only 1.5kb but its enough to cause stutters in webgl :(
     
    Last edited: Sep 17, 2019
    SVC-Games likes this.
  5. rob_unity7

    rob_unity7

    Joined:
    Feb 8, 2019
    Posts:
    37
    What version of SRP and LWRP are you using?
     
  6. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    154
    I think they fixed this in LWRP 7.0+ version, mostly.
     
    rob_unity7 likes this.
  7. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    366
    Looks like this is back in URP 7.1.8 and now does 251.7kb per frame, consistently.
     
  8. Elvar_Orn

    Elvar_Orn

    Unity Technologies

    Joined:
    Dec 9, 2019
    Posts:
    119
    Interesting!
    I'm running the URP Template Scene with 7.1.8 and not seeing any garbage being created.

    Can you file a bug with a repro so I can take a look?
     
  9. DatThax

    DatThax

    Joined:
    Jun 18, 2019
    Posts:
    10
    With URP 7.2.1, in the URP sample scene, adding a 2D renderer, setting the main camera to use it and adding a single 2D point light causes about 36B to be allocated per frame. It seems the more lights, the more garbage is created.

    I didn't change any materials to use Sprite-Lit-Default.

    This causes noticeable spikes when running a 2D game with 2D lighting.

    Edit: Running Unity 2020.1.0a23 for this test, but it also happens using 2019.3.2f1.
    Overall, performance is quite a bit better in 0a23 though.
     
  10. Aykutkaraca

    Aykutkaraca

    Joined:
    Jan 4, 2018
    Posts:
    31
    running 2019.3.6f1 and I have the same issue. I have URP 7.1.8.
     
  11. Shaunyowns

    Shaunyowns

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    328
    Hey @Aykutkaraca, can you file a bug with repro please?
     
unityunity