Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by SmittyA · Jul 21, 2019 at 03:03 PM · editorprofilerframeratevoxelgarbage-collection

What causes an increase in editor GUI garbage collection?

In editor, I see massive and regular spikes from GC.Collect which freeze the game for anywhere from 200ms to over 1000ms. These spikes do not register in the normal profiler mode, only when profiling the editor itself. These spikes (and game freezing) also do not occur in standalone builds at all, only when testing in-editor, and always related to GUI in some way. I do not have any UI in the scene, only a camera and meshes. Do you know what might be causing these huge spikes, and/or how I might fix this?

Full disclosure: this is part of a procedural, voxel prototype, which I know are prone to performance and memory management issues. I've done my best to structure the code to be performant, and limit unnecessary GC parsing of the heap, thanks to the profiler - that said, I can't rule out that something from gameplay isn't increasing the workload for the editor in some way, leading to this issue. I'm hoping that someone might be able to shed some light.

Sorry in advance if the formatting is bad, new lines aren't showing up in the preview...

alt text

profiler-02.png (38.3 kB)
profiler-01.png (105.5 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Namey5 · Jul 22, 2019 at 05:15 AM 1
Share

It looks as though the GC calls are under I$$anonymous$$GUI for the Unity Editor itself; in particular the game view panel. I would imagine it's just part of how the game view is drawn/maybe even the profiler. Do you still get these spikes when running the scene normally, or only when profiling the game view?

avatar image SmittyA · Jul 22, 2019 at 03:14 PM 0
Share

No matter what windows I leave open or close, the spikes don't change. Even with the profiler not recording and closed. I did notice that changing my world's size (like "view distance" in $$anonymous$$inecraft) changes the severity of the spikes, but I just can't see/understand the connection between world size and editor GUI. Still runs perfectly in a build, but it makes testing in editor a challenge.

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by SmittyA · Jul 22, 2019 at 05:32 PM

I hope it's okay to answer my own question.

I tried testing with "Maximize on Play" enabled, and the hitches disappeared. This led me to realize that the panels themselves are triggering GC.Collect. More panels meant a more frequent spike. so it's not that it's not that I don't have the issue in a build, it's that the garbage collector simply isn't being triggered because the heap doesn't change after the initial load. I added a script to manually trigger GC.Collect, and sure enough, I get the same spike. I guess my code isn't as optimized as it could be. I hope this helps someone else seeing this issue!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by marchall_box · Oct 17, 2021 at 08:51 AM

Hello,

I am specifically noticing this on Unity 2020 LTS on editor while I have the Animation Transition GUI window open. alt text

I guess there is no really a solution but close/open the specific GUI window to reset the memory if the hiccup is getting bad?


capurtrer.jpg (248.7 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

149 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Huge Framerate Drop 0 Answers

Is there a way to check the performance in edit-mode? 1 Answer

SendMouseEvents - GC Collect Spike Issue 1 Answer

Why is my build running so slow despite running fine in editor? 2 Answers

Locate cause of massive frame rate drop 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges