Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 e-bonneville · Mar 18, 2011 at 03:22 AM · gcfatal-errorroot-sets

Fatal error in GC: too many root sets

What does this mean!?

Haha, thanks, Elliot Bonneville.

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

3 Replies

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

Answer by DaveA · Mar 18, 2011 at 04:26 AM

Bug it seems: http://forum.unity3d.com/threads/78282-GC-gives-a-fatal-error

Comment
Add comment · Show 8 · 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 e-bonneville · Mar 18, 2011 at 01:03 PM 0
Share

Ah, thanks for the link. After having read the thread, it seems that this bug is caused by restarting the Editor Player too many times. For example, if you were making small tweaks to something and checking how it looked, dozens of times. I'm glad to hear it's not something related to my project. :)

avatar image Joshua · Jun 09, 2011 at 03:05 PM 0
Share

Ah so that's the reason. Still not fixed, btw..

avatar image dingben · Jun 27, 2011 at 06:52 AM 0
Share

refreshing... 1 thumb up, that one scared the wheels off me land rovuh...
Nice to find a quick&ready answer t.y.

avatar image SimonW · Sep 30, 2011 at 09:16 AM 0
Share

I don't know what causes it, but it's nothing to do with how many times you restart the editor - I just had it happen within 5 $$anonymous$$utes of restarting my machine.

avatar image dingben · Oct 05, 2011 at 05:37 PM 0
Share

@SPECS: [WIN7 Pro, 4Gig, Duo2.66, x86-on-64bit] [Unity 3.4.0f5{latest patch not installed}] [$$anonymous$$onoDevelop 2.4.2] (was on old original code editor when error popped up) ---

@Simon: can you provide OS, UnityVersion, Code Editor

@ALL: $$anonymous$$y project has many sections. I have been away from the section that got this error and I never got the error anymore. I will report when I am back in the culprit section for a month or so.

...we should all keep in $$anonymous$$d that versions and levels of systems are moving so fast we may never know the answer... just as long as the error vanishes.

Show more comments
avatar image
0

Answer by Clausman · Oct 13, 2011 at 03:55 PM

No idea if this can shine any more light, but I can produce the error in about 10 second by spawning lots of small computation threads. I am guessing at about thread 100 or so the error gets thrown. Each thread calculates a single line or code and another one is created immediately after the previous one finishes. Given this it is most surely an issue with resource allocation. In my case I am 99% sure I am overloading the garbage collector by creating way more threads than is sane.

Search around for "garbage collection too many root sets" MSDN has a mildly helpful article about best practices and explains root sets decently well.

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 Clausman · Oct 13, 2011 at 04:10 PM

I produced the same error creating far too many short-lived threads. It is definitely a garbage collector error. You are only allowed a set number of root elements and the error is basically saying that the storage for root elements just tried to overflow. if you search for "garbage collector too many root sets" you can learn some more. However, since I don't believe we get access to the compiler flags in Unity there isn't much you can do besides try to make your code more 'GC friendly.' MSDN has an okay article explaining gc practices and root sets which you may want to skim. Otherwise avoid recursion and local declarations if possible; oh and don't create 100+ threads that only do one line of code each :)

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Fatal error in GC: Too many hash sections and too many root sets? 0 Answers

Fatal error in gc: too many threads 1 Answer

Fatal error in gc: GetThreadContext failed (?) 7 Answers

Changing value of an entire Array causing problems 0 Answers

Is it possible to change the definition of '~' from that of a destructor/finalizer and into that of an underscore '_' ? 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