-
Notifications
You must be signed in to change notification settings - Fork 60
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
jit-dasm-pmi - add explicit GC #164
Comments
I saw it on Windows too. AFAIR it involved a
Stupid idea of the day - create a finalizable object right at the start of PMI and have its finalizer block indefinitely so no other finalizers get to run. You may also try to enable the Server GC, that one is more lazy with collection. Or try |
How about this? I think we still need to
Also This worked for me on Linux/x64 which doesn't prove it will always work ... |
I don't think being implemented in unmanaged code precludes GC allocations. But in the case of this particular method, yes, it's unlikely that it allocates. I would guess that just WaitForPendingFinalizers should be enough but it's probably good to keep TryStartNoGCRegion as well, provided that it doesn't have any negative side effects. |
On Linux (x64 and arm32) the following observed when there is a race between JIT compiling method and the finalizer thread (and the finalizer also got jitted).
It was suggested by @AndyAyersMS and @BruceForstall to explicitly call GC (e.g. before PrepareMethod) so GC happens more predictably. It worked for me but this makes jit-dasm-pmi much slower - so it makes sense to add this as an option which can be specified in command line (say,
--force_gc_collect
)?I have never seen this happening on Windows though.
The text was updated successfully, but these errors were encountered: