-
Notifications
You must be signed in to change notification settings - Fork 538
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
MONO GC log messages are not being printed in .net8.0-android #9720
Comments
I work on the same team with @jfichtner. We've found that, in addition to the logging, we are unable to configure the MONO garbage collector to run concurrently. We've tried setting the environment variables, like so: Environment.SetEnvironmentVariable("MONO_GC_PARAMS", "major=marksweep-conc-par"); and we've tried configuring it through the <AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent> However, according to the struct returned by |
@jfichtner wrote that they were using:
This isn't correct;
(Note the double-quoting.) With these set, a
If we add
and restart the app, we get slightly more:
If you set the
then you'll see a bit more about the GC bridge:
This was added to .NET 9 with 32495f3. |
That said…. We appear to have at least a couple of bugs here. (Doh!) Firstly,
then
doesn't log all the variables! It only sets
Which would make me think that Okay then… Next is the
then only
We then return to the original comment, and a desire to see We've horrifically broken things in this area. |
Wow, thanks for looking into this @jonpryor! Sounds like there is a bit of a mess to clean up. I have a couple of comments/questions... This is neither here nor there, but the adb command that I quoted did work in xamarin.android, and it was suggested to me in issue #6483 by @grendello. Perhaps it's not the correct way to do it, though. More importantly, what we REALLY need to to be able to turn on concurrent GC, and to somehow verify that concurrent GC is on and working. This is the reason we needed to enable the logs. As @cdahlstrand mentioned, it seems as though we cannot enable the concurrent GC. Can you confirm that there is actually no way to enable the concurrent GC in .NET8? |
.NET 8. Oh. I was testing on .NET 9… .NET 8 appears to be "better", but not perfect. I still can't get it to generate Where .NET 8 is better for me than .NET 9 is when using
and when I view
showing that
Neither of those was true in .NET 9: with .NET 9, the contents and/or updates within my environment file were not present in All that said, while I have found that we can set e.g.
None of the messages appear to state which GC parameters are in use. |
Just FYI, we don't populate the _concurrent flag in the struct on Mono so it will always be false: https://github.com/dotnet/runtime/blob/e417d2bbce348b5f06b2bfe9ed3ab0b190379f24/src/mono/System.Private.CoreLib/src/System/GC.Mono.cs#L251-L260 The concurrent sgen is enabled by default now: Line 9 in 70bd636
However that property basically also sets MONO_GC_PARAMS so depending on the above findings I wonder what the runtime defaults to if that's not set. |
So am I understanding correctly that there is no way to detect if using the AndroidEnvironment file to turn on concurrent GC actually works or not in net8-android? |
Android framework version
net8.0-android
Affected platform version
.NET 8.0.405
Description
My team is developing an application that was recently converted from Xamarin.Android and Xamarin.Forms to .net8-android and .NET MAUI. It seems that after this conversion, the MONO garbage collection logging cannot be configured using the same methods as were previously used. I had actually created issue #6483 for a similar issue I had previously when upgrading within the Xamarin.Android framework, which changed the default log level. In this ticket, @grendello provided me with the following adb command to set an environment variable that would turn this logging back on:
$ adb shell setprop debug.mono.log default,mono_log_level=info,mono_log_mask=gc
However, setting this environment variable no longer results in the MONO GC log messages being displayed, and I cannot find any information regarding how to configure this logging in .net8-android.
Steps to Reproduce
$ adb shell setprop debug.mono.log default,mono_log_level=info,mono_log_mask=gc
Did you find any workaround?
No
Relevant log output
The text was updated successfully, but these errors were encountered: