Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

[UWP] [WMR] Getting System.OutOfMemoryException on .Net native enabled Master Build

Discussion in 'VR' started by omkar-patil, Dec 20, 2018.

  1. omkar-patil


    Nov 18, 2014
    Our unity project porting to WMR PC x86 is facing issues with memory in Visual Studio Master build. The build works flawlessly with release and debug version of build but crashes with OutOfMemoryException in Master build case.
    In Visual Studio profiler I noticed the app is forced to use only 1GB RAM space which is 2GB in case of other builds, any further loading crash the application.
    In our project we are reading bytes with System.IO.File.ReadAllBytes() this fails if memory usage exceeds 1GB .
    Its a real-time OutOfMemoryException. After adding Garbage Collector System.GC.Collect(). Also wont resolves the problem. Its quite confusing the build works properly in release and debug mode but crashes in Master having Compile with .Net native tool chain flag Enabled. We are using .Net scripting back end But we also tried il2cpp seems there is also memory problem.

    Using Unity 2017.4.12f1
    Scripting Backend: .Net
    Target : x86
    Visual Studio: 2017.