Search Unity

  1. Unity 2019.1 beta is now available.
    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're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Huge spikes on the profiler caused by EndFrameTransformSystem

Discussion in 'Entity Component System and C# Job system' started by georgeq, Sep 14, 2018.

  1. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    405
    At first I though it was some of my system causing the problem, then on the timeline I noticed that on every spike there was a call to GC.Collect on one of the worker threads and occasionally on the main thread as well, but as far as I know I'm not doing anything that generates garbage. I order to be sure I disabled my systems on the entity debugger, but the spikes continued, so I disabled all systems and the spikes went away. Then I started to enable one by one each system until I reached EndFrameTransformSystem, which made the spikes appear again, then I went to the hierarchy I could see it is indeed generating garbage.

    _efts1.png

    Empty scene and the only system working is EndFrameTransformSystem.

    _efts2.png

    As you can see on the screenshots I'm using 2018.3.0b1 but also happens on 2018.2.6f1 although is less notorious.
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    866
    Expande hierarchy on second screenshot and show here please
     
  3. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    405
    Here it is:

    _efts3.png
     
  4. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    866
    You have many ISharedComponentData in you system?
     
  5. mike_acton

    mike_acton

    Unity Technologies

    Joined:
    Nov 21, 2017
    Posts:
    98
    Yes, will be fixed up once I couple of dependent things get resolved first.
     
    wobes likes this.
  6. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    405
    No, and even if I would the only system enabled is EndFrameTransformSystem, no other system is running. You can see it yourself on your own project: Create a new empty scene, hit play, go to entity debugger, disable all systems except EndFrameTransformSystem, open the profiler and watch.

    Thank you!.. just take into account same thing happens with EndFrameBarrier.
     
  7. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    866
    In my project with sufficiently heavy systems (2018.3.0b1 nd on 2018.3.0b2 too, ECS package preview.12) all works fine without any GC spikes. Only my own CPU spikes, when I do manual render on second camera for specific features.
    upload_2018-9-14_21-32-54.png
    upload_2018-9-14_21-36-52.png
     
  8. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    405
    No idea why this happens. I have an empty scene and except for EndFrameTransformSystem it's completely idle, yet I see spikes at regular intervals.
     
  9. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    3,492
    Just wonder, did you try restart Unity?
    If I keep unity for a while, it has some memory leak. Then it slows down.
    Can bee felt after few days of running.
     
  10. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    405
    Yes I did, but that doesn't solve the problem.
     
  11. maikramer

    maikramer

    Joined:
    Jun 2, 2017
    Posts:
    9
    Having the same problem, i have ecs included in the project but i'm not using yet.
     
  12. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    561
    Hello mike. May I ask, are you planning to fix the issue soon? Because the spike is huge.



    Thank you.
     
  13. marklama

    marklama

    Joined:
    Dec 7, 2016
    Posts:
    1
    Hi

    I just updated to Unity 2018.3f02 using ECS 0.0.12 preview 21 - this problem has come back in a massive way. I'm not only getting large spikes in performance every few seconds (80-100ms spikes), with lots of garbage collection but also the profiler is periodically freezing every few seconds, roughly coinciding with the performance spikes. This happens on EndFrameTransformSystem (GatherUpdateChunks) even when there are no entities in the scene (i.e. a blank scene). When the main scene is used, it appears at different systems - always relating to the GC - which EndFrameTransformSystem is creating a lot of.

    I'm assuming it was previously fixed as we didn't notice it in 2018.2.18. I have reverted back to 2018.2, as the new version is currently unusable.

    thanks
     
    wobes likes this.
  14. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    561
  15. sol-linux

    sol-linux

    Joined:
    Jun 10, 2015
    Posts:
    1
    Try to turn off leak detection (in Jobs->Leak Detection (Native Containers). Notice that this feature automatically turns on when you hit play button.