Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by Rukas90 · Oct 04, 2017 at 11:41 AM · optimizationprofilergarbage-collectionspikesstacktrace

Garbage Collection (StackTraceUtility) - Profiler Spikes

Hello everyone.

Whenever I profile my game I keep getting Garbage spikes. I checked and the most Garbage comes from something called 'StackTraceUtility'. And I also get huge random spikes from 'Others'. Is it also part of Garbage Collection?

I checked about this on the internet, but haven't found much useful information. Can someone please give some tips on how can I fix / avoid this annoying issue? Thank you!

Profiler: alt text

After Deep Profile: alt text

profilerspikes.png (184.0 kB)
afterdeepprofile.png (218.0 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Bunny83 · Oct 04, 2017 at 12:50 PM

Do you have any Debug.Logs somewhere in your code which are executed every frame? Debug.Log has a huge hit on performance, especially inside the Editor. Each log has a full stacktrace which can be viewed in the console. Avoid using Debug.Log every frame. This should only be done temporarily for debugging purposes and removed immediately after.

You may have other things in your code which is generating garbage. You can switch the profiler into "deep profiling mode". This mode has a much larger impact on the performance in the editor, but it tells you exactly which method is being executed how many times a frame and how much memory got allocated by each method. This should help to track down what is generating garbage.

Comment
Add comment · Show 2 · 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 Rukas90 · Oct 04, 2017 at 01:22 PM 0
Share

Thank you for the answer! :) I haven't called any Debug.Log. The console is empty. I tried to deep profile my game and I got some more 'detail' information, but I still can't understand what is causing the problem.. (The source of the issue). Could you maybe take a look?

After Deep Profile: alt text

afterdeepprofile.png (218.0 kB)
avatar image Bunny83 · Oct 04, 2017 at 01:46 PM 0
Share

Well, it seems the log is generated from the rendering thread due to some issues during rendering. Have a look at this forum post. It seems that it is possible that those errors doesn't show up in the console but are only dumped into the editor log. Have a look at the editor log when it happens. You may want to restart Unity before this test to get a clear editor log.

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

77 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

Related Questions

large sudden profiler spike 0 Answers

Why do I have sporadic spikes in the profiler? 0 Answers

SendMouseEvents - GC Collect Spike Issue 1 Answer

Spikes for Render.Prepare 1 Answer

Profiler shows Object.ElementAddr_3_8() called over a million times. What is it? How do I reduce this? 1 Answer


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