• 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
0
Question by sercanaktanbeyn · Mar 04, 2019 at 09:13 AM · crashgarbage-collectiongcgarbage collectiongc.collect

Firebase garbage collection bug, trigger GC manually ? ,Firebase garbage collection bug, trigger GC manually

Current Firebase Sdk (5.5.0) has a garbage collection bug. They know this issue and they have a temporary solution.

https://github.com/firebase/quickstart-unity/issues/191

To summarize, @chkuang-g discovered a general issue with garbage collection across the SDK. If you create an object release the reference then create effectively the same object (e.g the same database reference) again it's possible for the SDK to end up with two C# objects, one in the garbage collection queue and the other held by the application, pointing at the same C++ object. When the object in the garbage collection queue is finally deleted, it also deletes the C++ object and we end up with a C# object referencing a stale pointer to a C++ object. @chkuang-g is working on a fix at the moment. In the meantime, you should keep references around to objects that are reused on a regular basis in your application.

This problem also cause unity crash if you play and stop constantly without waiting for GC. For example if I close the unity completely after a session. And reopen again there is no problem. So I would like trigger GC manually, and simulate like closing the unity. But I could't do this. Looks like GC.Collect() doesn't change anything.

Probably they will fix the problem on next releases. Until that fix, I need to solve the problem manually.

Does anyone know, calling GC manually ?

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

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

107 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

Related Questions

Is it possible to change the definition of '~' from that of a destructor/finalizer and into that of an underscore '_' ? 1 Answer

Gc.Collect locations on the Profiler 1 Answer

Is generational garbage collection enabled in Unity 5.5? 1 Answer

how does houses in the nature deal with garbage and other kinds of waste 1 Answer

Performance issue due to too many if statements. 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges