Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Origin/remove redundant gc collect #1265

Merged
merged 2 commits into from
May 1, 2020

Conversation

rarepops
Copy link

@rarepops rarepops commented Mar 4, 2020

During unload_thread_main, we call mono_gc_collect 3 times.

First: https://github.com/mono/mono/blob/280e9d2423549d86686716f0818bcdbac9702ea1/mono/metadata/gc.c#L455

Second: https://github.com/mono/mono/blob/b4c506c3045516349d03ce8f3fe9fa5b79a7271c/mono/metadata/appdomain.c#L3305

Third: https://github.com/mono/mono/blob/b4c506c3045516349d03ce8f3fe9fa5b79a7271c/mono/metadata/appdomain.c#L3324

This PR #ifdefs the Second GC Collect because Boehm does not use remsets, and the comment explaining it mentions that

We need to make sure that we don't have any remsets pointing into static data...(cont)
However, Unity uses Boehm so it can be defined out.

There seems to be no good reason for the third GC collect, as it is already called before in mono_domain_finalize

@unity-cla-assistant
Copy link
Collaborator

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Rares Sebastian Popa seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@rarepops rarepops requested a review from joncham March 4, 2020 16:01
@joncham
Copy link
Member

joncham commented Mar 4, 2020

Looks okay to me. Might be worth trying to land upstream PR and se feedback/test results there before merging here?

@joncham joncham merged commit 8445d99 into unity-master May 1, 2020
@joncham joncham deleted the origin/remove-redundant-gc-collect branch May 1, 2020 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants