dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.92k stars 526 forks source link

Can't get GC info from Monp #9287

Closed albilaga closed 2 weeks ago

albilaga commented 2 weeks ago

Android framework version

net8.0-android

Affected platform version

.NET 8.0.401

Description

It seems .net android can't get GC info in console. Based on this Xamarin University course the Android debug should already contains GC info, but in reality it isn't. iOS is working fine with adding environment like

MONO_LOG_LEVEL=debug
MONO_LOG_MASK=gc

I also tried adding environment.txt for Android with build as AndroidEnvironment with content above but still the same.

Steps to Reproduce

  1. Clone this project https://github.com/albilaga/MauiIssues
  2. Run android app
  3. It should output something like this debug: GC_MINOR: (Nursery full) time 3.07ms, stw 4.03ms promoted 149K major size: 896K in use: 203K empty reserved: 128K los size: 1024K in use: 147K but it isn't

Did you find any workaround?

No workaround and no GC info for now

Relevant log output

No response

grendello commented 2 weeks ago

Did you try setting this property:

$ adb shell setprop debug.mono.log mono_log_level=debug,mono_log_mask=gc

You can use all instead of gc to see all the diagnostics. Make sure to make the logcat buffer bigger and clear it before starting the app:

$ adb logcat -G 64M
$ adb logcat -c
albilaga commented 2 weeks ago

@grendello thank you. this is working now. closing this