Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    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. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    355
    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:
    282
    Expande hierarchy on second screenshot and show here please
     
  3. georgeq

    georgeq

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

    _efts3.png
     
  4. eizenhorn

    eizenhorn

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

    mike_acton

    Unity Technologies

    Joined:
    Nov 21, 2017
    Posts:
    97
    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:
    355
    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:
    282
    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:
    355
    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:
    1,426
    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:
    355
    Yes I did, but that doesn't solve the problem.
     
  11. maikramer

    maikramer

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