We were unable to reproduce the reported issue "Out of memory exception during build in Release mode with 'Compile with .NET Native tool chain' option checked" from our side. But, previously we have come across this issue while using Windows 10 Operating System and Visual Studio 2015 without latest updates. The problem resolved automatically after Windows 10 Operating System and Visual Studio 2015 update(latest).
In the following MSDN forum, they have suspected this issue to be environment issue. So could you please check this issue in another enviroment with latest updates and let us know the results?https://social.msdn.microsoft.com/Forums/sqlserver/en-US/fe886e23-5d08-4fa1-a6a4-d7a8404ca169/net-native-tool-chain-memory-issue?forum=wpdevelop Note:
Ensure free space in local drive while compiling project with .NET native tool chain.