Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Renderering stops every couple of seconds with Profiler attached?

Discussion in 'High Definition Render Pipeline' started by dgoyette, Feb 2, 2023.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    I was profiling today (latest 2021 LTS version), using the Standalone Process option, and Deep Profiling. When set up this way, I was finding that every couple of seconds, things would appear to stall out/hang, for nearly 3000ms each time it happened. Here's a bit of the profiling results demonstrating the hitches. Notice those deep dips where it seems like everything halts for a frame:

    upload_2023-2-2_9-39-12.png

    In inspecting each of those dips, I'll see various causes, nothing every consistent, except that they're all ultimately executed within HDRenderPipeline.ExecuteRenderRequest. Here are some examples of inspecting each of the dips.

    Notice that each time it's for some different bit of code. However, the pattern is very similar with all of them: Nearly 3000ms of time per stall, and the time being used up is 99% "self ms".

    upload_2023-2-2_9-41-19.png

    upload_2023-2-2_9-41-51.png

    upload_2023-2-2_9-42-16.png

    upload_2023-2-2_9-42-39.png


    Any idea what might be going on here? I'm tempted to assume this potentially a profiling bug, as I don't seem to notice any long hitches while actually running the scene.
     
    alexeyzakharov likes this.
  2. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
  3. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    Your assumption looks valid. To offer some confirmation of it, I profiled again after using -profiler-maxusedmemory to set the profiler memory to about 3x what the default is. The result was that the "drops" were significantly more spaced out, but that they took significantly longer to "cleanup" each time. For example:

    upload_2023-2-2_15-58-50.png

    It's also worth mentioning, in case it's not obvious, that those timing values (8861 ms in that screenshot) aren't actually how long the frame takes to render. It actual seems to render pretty much as fast as normal. So I'm guessing that number is something like the number of ms between drops, if anything.

    Anyway, I appreciate the explanation. I'll consider this behavior something I can ignore while profiling, and it's pretty easy to ignore given all the rendering and memory usage drops to 0 for the frames where this occurs.
     
    alexeyzakharov likes this.
  5. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    FWIW, this became a lot more clear when I was profiling a build rather than in editor. Every couple of seconds I'd see console log entries like this:

    Is this is a new issue? I don't remember seeing anything like this in the past when profiling. It mentions not being able to flush to a file or socket. Am I meant to be specifying a file for it to be writing to while profiling?
     
    Last edited: Feb 3, 2023
  6. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    429
    That's a long shot but aren't you running out of hard disk space perhaps?
     
  7. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    Nope. Maybe I'll go back to an earlier Unity release and see if I'm seeing this. But it feels like a recent warning/behavior.
     
  8. DebugLogError

    DebugLogError

    Joined:
    Jul 24, 2013
    Posts:
    57
    I'm also running into this with 2022.3.7f1 LTS.
     
  9. HANGIYA_2016

    HANGIYA_2016

    Joined:
    Jan 18, 2017
    Posts:
    36
    I had the same problem and had to wait for a fix.
     
  10. zhare86

    zhare86

    Joined:
    Mar 28, 2017
    Posts:
    28
    In what version was it fixed?