Search Unity

Profiler shows massive spikes in active constraints

Discussion in 'Physics' started by kstothert, Nov 7, 2018.

  1. kstothert

    kstothert

    Joined:
    Dec 8, 2016
    Posts:
    68
    here is a screenshot of the profiler

    Screen Shot 2018-11-07 at 2.26.26 PM.png
    most frames are steady at around 5k active constraints but this spikes to almost a million at it's worst.

    Where might i find the cause of this spike?
     
    DavidSWu likes this.
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    Constrains of what?
     
  3. kstothert

    kstothert

    Joined:
    Dec 8, 2016
    Posts:
    68
    thats my question, how do i find the cause of all these constraints
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    Disable some objects, observe profiler and try find which one(s) is/are cause.
     
  5. DavidSWu

    DavidSWu

    Joined:
    Jun 20, 2016
    Posts:
    183
    I am seeing the same thing, but I am getting up to 105k constraints. I will attempt to isolate it, but it would be helpful if there were a way to discover what kind of constraints we are talking about.
    We have a voxel based game and there are about 60k voxels in the scene that I am testing with (damn UGC).
    However, 95% of them are static and without rigid bodies.
    We have less than 20 contacts most of the time.
    Oddly it is 0 for a period and jumps up to 105k for a few frames, then falls back to 0 and the cycle repeats.

    upload_2019-2-26_1-47-30.png
     
  6. Ruufer

    Ruufer

    Joined:
    Jul 28, 2016
    Posts:
    17
    I'm having the same issue and a lot of difficulty isolating, so far no luck.
     
  7. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    401
    hi, I am looking at similar behaviour in the profiler however I know what is causing it in my case (suggestions on how to fix welcome). Essentially I am instantiating a destructing object (a rock) which is composed of ~20 subobjects partially into a terrain. They explode nicely but the physics simulation eats GPU before stabilising. Moving the object slightly so it does not intersects the terrain fixes the problem. I will probably try carving a "crater" in the terrain as I need to do that anyway..
     
  8. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    401
    FYI in case anyone is interested carving out a section of the terrain to reduce the overlap fixed the problem for me, and I needed a crater anyway :)
     
  9. tommohawkaction

    tommohawkaction

    Joined:
    May 20, 2017
    Posts:
    27
    Did anyone solve this, I too am having this issue in Unity 2019.3.5f1
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Anyone got a bug case number or code?
     
  11. TrentSterling

    TrentSterling

    Joined:
    Jan 4, 2013
    Posts:
    99
    I'm seeing this odd behaviour too. Would be nice to understand whats going on here?

    Number is normally low, but keeps spiking to nearly 100k active constraints? Its just 10-20 rigidbodies in a static scene! There can't possibly be that many interactions going on?!
     
  12. tommohawkaction

    tommohawkaction

    Joined:
    May 20, 2017
    Posts:
    27
    Did anyone fix this as I'm still getting around 40k - 100k active constraints. I think it has something to do with Joints and Kinematic Objects being moved
     
  13. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    883
    I am seeing this also,
    200-300 constraints yeah maybe, but 300k constraints smells like a bug
     
  14. Melnikovv

    Melnikovv

    Joined:
    Oct 21, 2016
    Posts:
    8
    8.7m constraints...
    No joints, just rigidbodies with no constraints
    upload_2020-11-17_0-20-4.png
     
    dreasgrech, chadfranklin47 and Ruchir like this.
  15. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    229
    Yeah having the same issue here. I have characters with Rigidbodies, but I have the bone hierarchy root object set to inactive. Spikes frequently to 65.5k constraints from 0 with one character. Millions of constraints when many characters are spawned.
     
    Last edited: Mar 4, 2021
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Any bug report numbers?
     
  17. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    229
    Ryan_McMahon and dreasgrech like this.