Articles in this section
Category / Section

How to restrict system out of memory exception in UWP?

2 mins read

While running the application with .Net native chain tool in Release mode, it requires more memory space to build the application. Because .NET Native tools are compiled IL libraries with managed code in native libraries. And in our "Syncfusion Controls for UWP XAML" SDK contains more number of assemblies. We can resolve this SystemOutofMemory exception using UWP.

Way 1: Refer only needed assemblies of Syncfusion instead of referring Syncfusion UWP SDK.

Syncfusion UWP SDK has assemblies for all controls where you can refer assemblies needed only based on the control you are using.

Assembly Location:

$system drive:\ Files\Syncfusion\Essential Studio\$Version # \Assemblies for Universal Windows\[TargetFramework]

Ex: Program Files (x86)\Syncfusion\Essential Studio\15.2.0.40\Assemblies for Universal Windows\10.0

Also, you can find the list which contains assemblies and dependency assemblies of the control from below location.

https://help.syncfusion.com/uwp/control-dependencies

Way 2: Enable Use64BitCompiler in project

We already reported this issue in VisualStudio community forum and they have suggested to use Use64BitCompiler as work-around to solve the issue while compiling the project with Nuget which contains more number of Assemblies. Please find the work-around from below,

 

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">

 

<OutputPath>bin\x86\Release\</OutputPath>

 

<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>

 

<Optimize>true</Optimize>

 

<NoWarn>;2008</NoWarn>

 

<DebugType>pdbonly</DebugType>

 

<PlatformTarget>x86</PlatformTarget>

 

<UseVSHostingProcess>false</UseVSHostingProcess>

 

<ErrorReport>prompt</ErrorReport>

 

<Prefer32Bit>true</Prefer32Bit>

 

<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>

 

<Use64BitCompiler>true</Use64BitCompiler>

 

</PropertyGroup>

 

 

Note: System configuration or requirements for using 64 bit compiler:

64BitCompilation will trigger only if we use UWP tools 2.0 which will support in Visual Studio 2017 15.4 and Windows 10 Fall Creators Update.

https://devblogs.microsoft.com/dotnet/announcing-uwp-support-for-net-standard-2-0/

We can ensure whether the 64BitCompilation triggered or not by ensuring the reference path of nutc_driver.exe in compilation log file located in object folder.

For example, our UWP application has log file in below folder,

App1\obj\x86\Release\ilc\ilclog.csv

Open the log file and search for nutc_driver.exe, if the path of the nutc_driver.exe has same as the following command line (nutc_driver.exe should refer from the Tools64 folder instead of Tools) we can be sure that the 64BitCompilation is triggered in our project.

C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.native.compiler\2.0.2\tools\x86\ilc\Tools64\nutc_driver.exe

Link :

https://developercommunity.visualstudio.com/t/cant-build-uwp-app-which-has-more-nuget-references/187413

Conclusion

I hope you enjoyed learning about how to how to restrict system out of memory exception in UWP. You can refer to our UWP feature tour page to know about its other groundbreaking feature representations documentation and how to quickly get started for configuration specifications.  You can also explore our UWP example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied