Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Canvas.SendWillRenderCanvases allocating a lot of memory

Discussion in 'Unity UI & TextMesh Pro' started by gavin_dodd, Feb 24, 2017.

  1. gavin_dodd

    gavin_dodd

    Joined:
    Oct 20, 2015
    Posts:
    6
    SendWillRenderCanvases is allocating ~90k/frame

    I have a very dynamic set of images. I am pooling them but the sprite, matrix, active state etc. are touched every frame. I think if the set of images does not change then the same gameobects should get the same data set but even then the allocations stay the same.

    If I pause the game no images are touched and the allocation drops to ~9k, but even that seems high.

    There are 4 canvases (3 used to render to texture) and ~50 images in the scene and not much else.
     
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    570
    If one thing changes inside one canvas, all graphics in that canvas are rendered again.
    If you separate static things from things that change often with (sub-) canvases you can increase performance. Maybe it is even a good idea to separate the changing canvases more and pack things together which also change together...
     
  3. gavin_dodd

    gavin_dodd

    Joined:
    Oct 20, 2015
    Posts:
    6
    The problem is that everything is changing all the time.

    I think I was a bit tired when I posted so I forgot my actual question.

    What is allocating the memory and is there any way to reduce it?
    Currently GC is triggering every few seconds which is pretty annoying.
     
  4. mushdevstudio

    mushdevstudio

    Joined:
    May 9, 2014
    Posts:
    29
    When I disabled Pixel Perfect on the canvas the frame rate drop went away.