-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Garbage Collection causes a freeze with Shell. #25382
Comments
I do have sort of a repro project. This one throws the GC spam in the console when you press any item in the flyout. So in essence this test project gets one step further and actually opens the flyoutmenu. |
Hello @Gekidoku, Regarding:
Is this a regression from .NET |
From .net 8. In my csproject i have it set to .net 8 by way of Now going to try with an older version of maui.controls (8.0.6) |
Further testing on my end. Now going to try this on my acutal app. |
Ok my findings are going to make it difficult. <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.6" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.6" /> "Fixes" it for my regular app. Splashpage.cs DashSelector.cs DashRosterCell.cs SplashViewModel.cs DashItem.cs |
Wre now almost a month later. |
I see now that the 9.0.0 version is released. going to try this one |
Allright we have progress. <Color x:Key="Primary">#28aadc</Color>
<Color x:Key="PrimaryDarkText">White</Color>
<Color x:Key="FlyoutColor">LightBlue</Color>
<Style x:Key="BaseStyle" TargetType="Element">
<Setter Property="Shell.ForegroundColor" >
<Setter.Value>
<OnPlatform x:TypeArguments="Color">
<On Platform="iOS" Value="White"/>
<On Platform="Android" Value="Transparent"/>
</OnPlatform>
</Setter.Value>
</Setter>
<Setter Property="Shell.TitleColor" Value="White" />
<Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.UnselectedColor" Value="Black" />
<Setter Property="Shell.FlyoutBackground" Value="{AppThemeBinding Light={StaticResource PrimaryBackground},Dark={StaticResource PrimaryDarkBackground}}"/>
</Style>
<Style TargetType="FlyoutItem" BasedOn="{StaticResource BaseStyle}" />
<Style Class="FlyoutItemLabelStyle" TargetType="Label">
<Setter Property="TextColor" Value="Black"></Setter>
</Style>
<Style Class="FlyoutItemLayoutStyle" TargetType="Layout" ApplyToDerivedTypes="True">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="Background" Value="Transparent" />
<Setter TargetName="FlyoutItemLabel" Property="Label.TextColor" Value="{StaticResource Primary}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="Background" Value="{StaticResource FlyoutColor}" />
<Setter TargetName="FlyoutItemLabel" Property="Label.TextColor" Value="{StaticResource PrimaryDarkText}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style> Removing this style causes the app to no longer freeze when setting the app shell as the main page. |
Interesting. I understand you can't share your full app, but thats not what a reproduction is about. In order to close in on why a style is making this go wonky it would be super helpful if you could still identify the moving parts and put that in a separate project, that would be super helpful. But seems this is fixed for you and I think an edge case so if you're not going to I can understand. I'll apply a label asking for a reproduction. If you don't want to just let it expire and it will close this issue for now. Thanks and great work on finding it eventually! |
I was able to get somewhat comparable behavior in this project. Again I'll push the version where I could reproduce it tomorrow. |
Ok i updated my project In this project i can reproduce it like this. |
Hi, @Gekidoku |
@BrzVlad could you take a look ^ |
Is there any indication in this issue that the hang is related to the runtime in the first place ? |
Sidenote I have since updated to the full release of 9.0.0 (Visual studio 17.12.0 and 9.0.0 for the maui libraries in my csproj) |
Description
After updating to the latest preview for Visual studio my maui app no longer works as intended on android. it already didnt work on ios for me.
What i see when i have a debugger is attached is that my shell loads in and then I see the app freeze and the console is filled with GC messages.
Explicit concurrent mark compact GC freed 224KB AllocSpace bytes, 0(0B) LOS objects, 79% free, 6219KB/30MB, paused 1.455ms,8.847ms total 81.461ms
I think this has to do with shell. As a test i already removed all but one flyoutitems from my shell but to no avail.
I also removed my image from my flyout item thinking maybe its due to loading in the image. but to no avail.
I then changed my app so it loads in the first page i have as my flyoutitem as its own page outside of the shell structure.
now i dont have the GC feed. So i think its something to do with the Shell itself.
Seeing as i cant exacly share the entire app since it requires access to our backend to properly work ill share the files i think are most relevant.
My appshell.
https://gist.github.com/Gekidoku/3c3e34201c4f0df59e7362e4a313338d
This is called the old fashioned .net 8 way. the assignment to AppShell is to a static variable so I can peek into it during debugging.
Its never used to get the instance of the shell.
Seeing as my screen doesnt freeze when SplashPage is called on its own i dont think whatever is in there is relevant.
Video demonstrating the issue the WebM and mp4 were too big.
Also for some reason my dotnet-dsrouter android cant use adb from my working directory but when i do it in a console from the same directory i can connect to my phone just fine. so geting GC dumps is a bit of a challenge.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
9.0.0-rc.2.24503.2
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
Android, iOS
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: