Search Unity

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

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

  1. omkar-patil

    omkar-patil

    Joined:
    Nov 18, 2014
    Posts:
    6
    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.