Skip to content

Commit

Permalink
fix: Add GC configuration for all net6 mobile templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban authored Apr 22, 2022
1 parent 19fbedf commit a2155bb
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,47 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net6.0-android'">
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.4.0.4" />
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.35" />
</ItemGroup>
<Choose>
<When Condition="'$(TargetFramework)'=='net6.0-android'">
<ItemGroup>
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.4.0.4" />
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.35" />
</ItemGroup>
<ItemGroup>
<AndroidEnvironment Include="Android/environment.conf" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-ios'">
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-ios'">
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.3.0" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-maccatalyst'">
<PropertyGroup>
<!-- Configure the GC -->
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>

<ItemGroup Condition="'$(TargetFramework)'=='net6.0-ios' or '$(TargetFramework)'=='net6.0-maccatalyst'">
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.3.0" />
</ItemGroup>
<!-- Required for unknown crash as of .NET 6 Mobile Preview 13 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>

<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-maccatalyst'">
<!-- Required for unknown crash as of .NET 6 Mobile Preview 13 -->
<MtouchExtraArgs>--registrar:static</MtouchExtraArgs>
<!-- Full globalization is required for Uno -->
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>

<!-- Full globalization is required for Uno -->
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.3.0" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)'=='net6.0-macos'">
<PropertyGroup>
<!-- Configure the GC -->
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
</PropertyGroup>
</When>
</Choose>

<Import Project="..\$ext_safeprojectname$.Shared\$ext_safeprojectname$.Shared.projitems" Label="Shared" />
</Project>

0 comments on commit a2155bb

Please sign in to comment.